amm – Finematics https://finematics.com decentralized finance education Fri, 04 Jun 2021 23:29:22 +0000 en-GB hourly 1 https://wordpress.org/?v=5.8.1 https://finematics.com/wp-content/uploads/2017/09/cropped-favicon-32x32.png amm – Finematics https://finematics.com 32 32 Sushi – Most Underrated Protocol in DeFi? (BentoBox, Kashi, Miso Explained) https://finematics.com/sushi-explained/?utm_source=rss&utm_medium=rss&utm_campaign=sushi-explained&utm_source=rss&utm_medium=rss&utm_campaign=sushi-explained https://finematics.com/sushi-explained/#respond Fri, 04 Jun 2021 23:29:21 +0000 https://finematics.com/?p=1361

Intro

So why is Sushi believed to be one of the most underrated protocols in DeFi? What are some of its new features such as BentoBox, Kashi and Miso all about? And what is Sushi’s approach to launching on different blockchains and scaling solutions? You’ll find answers to these questions in this article. 

Let’s start with a bit of background. 

Sushi launched in August 2020 during DeFi Summer – the first period of major growth of DeFi. The project quickly gained a lot of traction mostly due to the nature of its launch. 

Sushi – back then known as SushiSwap – aimed at directly competing with Uniswap by forking it and encouraging liquidity providers to move their liquidity to a new platform in a process called a vampire attack. 

The full story behind Sushi, although super interesting, is out of the scope of this article. Fortunately enough, I’ve already written an article about it some time ago and you can read it here if you’re interested. 

Sushi 

Almost a year later and the rocky launch of Sushi seems like a distant past and the team behind the protocol has been working hard on delivering new, interesting features and building the Sushi ecosystem. 

Besides the main function of Sushi – a decentralized exchange for swapping assets, the protocol offers a growing range of other products: a liquidity bootstrapping feature for other projects – Onsen; a lending platform – Kashi; a launchpad for new protocols – Miso. More on these later in the article. 

The Sushi team has a very open approach when it comes to deploying the protocol to different chains and scaling solutions. 

Instead of trying to predict which environment will be the most dominant one and will capture the most value, they deploy the protocol to all popular and upcoming environments and let the market decide. 

Besides the Ethereum mainnet, Sushi has already been deployed to Polygon, xDai, BSC, Fantom and Moonbeam with an upcoming launch on Arbitrum – a layer 2 Ethereum scaling solution.

Another interesting move was the acquisition of the sushi.com domain that should give the project even more visibility. 

Now, let’s dive a bit deeper into each of the Sushi features one by one.

AMM 

Automated Market Maker or AMM is the main function of Sushi that allows users to swap their assets in a decentralized and permissionless way. 

Sushi’s AMM is a fork of Uniswap V2, so these two work in exactly the same way. If you need a recap on AMMs and liquidity pools here’s a popular article that I wrote some time ago.  

Currently, Sushi is the second-largest AMM on Ethereum with around 16% of the market share. Uniswap remains an undisputed leader capturing around 54% of the total AMM market. 

Sushi’s daily trading volume, which is one of the most important metrics when it comes to AMMs, has been steadily growing from around $250M at the end of 2020 to over $500M in 2021 with some days hitting well over $1B.

Another metric – total value locked in the protocol – has also been growing from around $1B at the end of 2020 to as high as $5.5B and currently sitting at around $3.5B after the recent market downturn. 

One major difference between Uniswap V2 and Sushi is that the latter has enabled the profit-sharing mechanism which benefits the SUSHI token holders. Instead of 0.3% of trading fees going to the liquidity providers like in the case of Uniswap, Sushi enabled the fee switch which lowers the trading fee for the LPs to 0.25% while distributing the remaining 0.05% to the SUSHI token holders. 

And this leads us straight to the SushiBar. 

SushiBar

In order to benefit from profit sharing, SUSHI holders have to stake their SUSHI tokens in the SushiBar smart contract and receive xSUSHI that can be later redeemed for their original SUSHI plus additional SUSHI tokens coming from the swap fees. 

For every swap, on every chain, going through Sushi, 0.05% of the swap fees are distributed as SUSHI proportionally to the user’s share of the SushiBar. 

The xSUSHI tokens are fully composable and maintain voting rights in the Sushi governance. xSUSHI tokens can also be added to the xSUSHI/ETH liquidity pool where users can benefit from stacked yield coming from xSUSHI itself plus the extra rewards coming from the pool. 

The yield on SushiBar depends on the trading volume going through the Sushi AMM and has recently been at around 10% APR with days as high as 40% APR. 

Because of this profit-sharing mechanism, the SUSHI token is essentially one of the most productive assets in the DeFi space. In contrast to many other tokens driven mostly by speculation, SUSHI tokens should better represent the actual value of the Sushi protocol. 

Time for another Sushi feature also connected to the SUSHI token – Onsen. 

Yield Farming and Onsen

Onsen is a liquidity incentive system that accelerates new projects by providing extra rewards in the form of SUSHI tokens. 

Projects selected to be on Onsen are given a certain allocation of SUSHI tokens to incentivise liquidity provisioning for their own token. This means that the projects themselves don’t have to distribute their own token through liquidity mining and they can still benefit from incentivised liquidity. This is really useful for new projects that very often struggle to bootstrap liquidity, especially if they don’t want to initially distribute large amounts of their own tokens.

Onsen also benefits the overall Sushi ecosystem as the swap fees from the Onsen-enabled liquidity pools are distributed to the xSUSHI holders. 

Projects featured on Onsen are chosen based on their quality and the demand for their products. Some projects are featured only for a certain amount of time, while others can remain on the Onsen menu indefinitely, assuming the quality of the project and demand for their token remain high. 

On top of Onsen, Sushi offers permanent yield farming opportunities for popular and established tokens. These opportunities are also available on other layers, for example, Sushi has recently started a liquidity mining program on Polygon that offers high yields to liquidity providers. 

Time for yet another Sushi feature – BentoBox. 

BentoBox 

BentoBox is a special smart contract that acts as a vault for certain tokens. This vault is basically a pool of funds that can be used by Bento-enabled applications in the Sushi ecosystem. 

Users who deposit funds into one of the BentoBox vaults benefit from earning extra yield on their tokens. Vaults can generate yield in multiple ways, for example, by allowing other participants to take flash loans and pay a small fee that goes back to the users providing liquidity to the vaults or by lending out assets in the vaults. 

This structure is also very gas efficient as different applications operating on the same vault don’t have to go through as many steps as they would have to go through without the BentoBox architecture.  

At the moment, the first and only available Bento-enabled application is the lending platform – Kashi, but the team is working on bringing more applications to BentoBox in the future.  

And this is a good segue into Kashi. 

Kashi 

Kashi which means “lending” in Japanese is Sushi’s first lending and margin trading solution powered by BentoBox. Kashi allows anyone to create customised and gas-efficient markets for lending and borrowing.

In contrast to other popular DeFi money markets such as Aave or Compound, Kashi isolates each of the markets. This means that users can create markets for more risky assets without having an impact on other markets. 

Having the ability to borrow an asset also opens up the possibility for shorting it. This is useful for speculators who believe that the asset will go down in value but also allows for hedging, which can be extremely handy, for instance, when yield farming risky assets. 

As an example, let’s say a new token is launched. 

Someone can create a money market for the new token on Kashi which allows anyone to provide collateral in a chosen coin, let’s say ETH, and borrow the new token. The short seller can now borrow the new token and sell it immediately for ETH. If the price of the new token goes down in relation to ETH the short seller can buy back the new token at a lower price in the future and repay their loan denominated in new tokens. 

The main caveat is that in order to create a money market for a new token there has to be a reliable price oracle available. Kashi allows the user to choose a price oracle at the time of creating a new market. At the moment, only price feeds available on Chainlink can be used, limiting the number of possible new markets that can be created. However, the Sushi team is working on adding their own TWAP price oracle that would expand the set of available price feeds. 

Adding a new risky asset to one of the existing money markets would threaten the solvency of the whole protocol. This is because if such a coin was used as collateral and experienced a sharp drop in price this could make a lot of accounts undercollateralized and allow for a cascade of liquidations. On the other hand, if such a coin is borrowed and quickly multiplies in price this also creates a problem as borrowed assets are worth more than collateral, making the account undercollateralized again. 

Miso

The last but not least feature of Sushi that we’re going to cover in this article is Miso.

Miso is a token launchpad platform. It facilitates launching new tokens on Sushi. 

Miso focuses on providing a good experience for both the project creators launching new tokens and for people interested in finding and supporting these projects. 

When it comes to project creators, Miso offers a set of smart contracts that makes the process of creating a new token easier. On top of that it allows the projects to attract a larger initial audience than they may have been capable to reach on their own. 

When it comes to project supporters, they can benefit from having peace of mind that the token and infrastructure around the token was created using audited and battle-tested contracts. They can also easily discover new projects and participate in reliable token launches. 

Miso is clearly yet another important element of the overall Sushi ecosystem. 

Summary

With a steadily growing trading volume on its decentralized exchange, the profit-sharing mechanism for SUSHI holders, an increasing number of chains and scaling solutions to launch on and new features being added to the ecosystem, Sushi looks like one of the strongest DeFi projects. 

This is why a lot of people in the DeFi community believe that Sushi is underrated, especially when compared to other decentralized exchanges. It’s hard to say exactly why this is the case, but it might come from the fact that Sushi started as a fork of Uniswap and had a bit of a rocky launch. 

Nevertheless, Sushi is clearly one of the top DeFi protocols to keep an eye on and it will be interesting to watch new elements being added to BentoBox and the rest of the Sushi ecosystem, with the team pursuing new chains and scaling solutions. 

One of them is the previously mentioned Arbitrum – an Ethereum Layer 2 optimistic rollup-based scaling solution that looks like the next place where Sushi is about to launch. 

So what do you think about Sushi? 

If you enjoyed reading this article you can also check out Finematics on Youtube and Twitter.

]]>
https://finematics.com/sushi-explained/feed/ 0
What is Bancor V2? Chainlink Integration and Dynamic Automated Market Maker Explained. https://finematics.com/bancor-v2-explained/?utm_source=rss&utm_medium=rss&utm_campaign=bancor-v2-explained&utm_source=rss&utm_medium=rss&utm_campaign=bancor-v2-explained https://finematics.com/bancor-v2-explained/#respond Mon, 10 Aug 2020 13:45:31 +0000 https://finematics.com/?p=797

Intro

What is the latest update to the Bancor protocol called Bancor V2? Will Bancor V2 outcompete other decentralized exchanges such as Uniswap, Curve and Balancer? Also, why are Bancor V2 pools integrated with Chainlink? We’ll be going through all of this in this article.

Bancor

Let’s start with a quick recap of what Bancor actually is.

Bancor is an on-chain liquidity protocol that enables automated, decentralized token exchange on Ethereum and across blockchains. Launched in 2017 with one of the biggest ICOs in the space, the protocol is made up of a series of smart contracts designed to pool liquidity and perform peer-to-contract trades in a single transaction with no counter-party. Users add liquidity to automated market makers (AMMs) in exchange for trading fees, staking rewards and future voting rights in the BancorDAO. If you need a quick recap on liquidity pools and automated market-making you can read this article.

Why Was Bancor V2 Created?

Although Bancor was one of the first protocols that implemented liquidity pools it didn’t get as much traction as some of their competitors. There were a few reasons for this, mainly the requirement to use an additional BNT token to provide liquidity to every pool, high gas fees to execute contracts and a harder process to list new tokens. Some of these problems were already addressed even before launching V2, for example, the Bancor community created permissionless interfaces for listing new coins.

On top of the above problems, the Bancor Team identified a few key obstacles that they believe are stopping AMM from wider adoption. These include exposure to “impermanent loss”, exposure to multiple assets, capital inefficiency and the opportunity cost of providing liquidity.

To tackle each one of them Bancor V2 implemented a bunch of new features.

The biggest one is the introduction of a new AMM called a dynamic automated market maker or DAMM that addresses the first 2 obstacles impermanent loss and exposure to multiple assets.

Before we jump into the mechanics behind the DAMM, let’s make sure we understand what impermanent loss actually is.

Impermanent Loss

In essence, impermanent loss is a temporary loss of funds occurring when providing liquidity. It’s very often explained as a difference between holding an asset versus providing liquidity in that asset. Impermanent loss is usually observed in standard liquidity pools where the liquidity provider (LP) has to provide both assets in a correct ratio and one of the asset’s value is volatile in relation to the other, for example, in a DAI/ETH 50/50 liquidity pool.

If ETH goes up in value, the pool has to rely on arbitrageurs constantly making sure the pool price reflects the real-world price to maintain the same value of both tokens in the pool. This basically leads to a situation where profit from the token that appreciated in value is taken away from the liquidity provider. At this point, if the LP decides to withdraw their liquidity the impermanent loss becomes permanent. The full explanation of impermanent loss is outside of the scope of this article, but I’ll try to make another one just on this fairly complicated topic.

Dynamic Automated Market Maker

We can see the main driver for impermanent loss is the fixed ratio between the tokens. But what if we didn’t have to always rely on a fixed ratio between the tokens in a pool? What if we could dynamically balance the ratio of the tokens in a pool? This is where DAMM comes into play.

DAMMs make use of price oracles to determine if the balance between tokens in the pool should be changed. Price oracles such as Chainlink provide external prices to smart contracts in a decentralized and reliable way. They can, for example, provide a current price of LINK/ETH.

Before we go through a quick example, let’s introduce a concept of the staked and current balance.

Stake balance is the balance provided by the liquidity provider. This is basically the balance that the LP should be allowed to withdraw when they decide to finish providing liquidity. Current balance is a balance of the tokens in the pool also sometimes called the “reserve balance”. Bancor V2 DAMMs always incentivize market participants to bring the current balance as close to the staked balance as possible, making sure that the LPs can withdraw the number of tokens they provided to the pool and mitigate impermanent loss. One of the ways to achieve this is by using dynamic fees. So if the current balance diverges from the staked balance, the fees can be adjusted to incentive market participants to bring both balances closer together.

A V2 pool is always initialized in a balanced state so that the price offered by the pool (“pool price”) is equal to an external reference “market price” provided by price oracles. The V2 pools are designed to always push the pool price to equal the market price.

Let’s see how the balancing mechanism works.

We start with a liquidity provider supplying equal value of 2 assets to the pool. Let’s assume the pool hold 2 assets LINK and BNT.

This is how our pool looks like after the initial supply was added.

So far so good, the state of the pool is not much different from the V1 pools or the Uniswap pools.

The second step is when the magic happens. Let’s assume that the LINK price went up to $12 across multiple exchanges and the price is not reflected yet in our LINK/BNT pool. Normally it’d create an instant arbitrage opportunity that would be most likely taken by a market participant and result in impermanent loss for the liquidity provider. This is because the ratio between the tokens remains fixed.

In Bancor v2, price oracles would pick up on that price change and adjust the weights of each token in the pool accordingly. When the LINK price increases, the target weight of LINK in the BNT/LINK pool will grow and there will be no opportunity for arbitrage.

Let’s see how the pool looks like after the price oracle picks up the 20% increase in the LINK price.

As we can see the weights of both LINK and BNT tokens in the pool got adjusted automatically and this is one of the main features of Dynamic Automated Market Makers.

Exposure to Multiple Assets

The mechanism that we just described is also really useful when it comes to tackling another problem – exposure to multiple assets.

In the standard liquidity pool, liquidity providers’ chunk of liquidity is tracked by LP tokens that represent both assets that were provided to the pool. In Bancor V2 liquidity can be supplied to only one of the assets in the pool. So for example, if you have a BNT/LINK pool and you only want to get exposure to LINK, you can just supply LINK and there is no obligation to supply BNT. Because of the DAMMs and the integration with price oracles the V2 liquidity pool will be able to adjust the ratio between the tokens in the pool.

Additionally, for each V2 pool, the liquidity providers receive separate LP tokens for each of the assets provided to the pool.

If we go to our previous example we can see what would happen if someone supplied more LINK to our BNT/LINK pool.

Let’s start with the same initial balances in the pool as before. Now, instead of the increase in the price of LINK, let’s say a new liquidity provider adds 10 more LINK to the pool.

Again we can see that the token weights in the pool got adjusted automatically.

Tackling Capital Inefficiency

To tackle another problem that is capital inefficiency, Bancor V2 introduces a more efficient bonding curve that reduces slippage. Let’s see what it means.

Bonding curves represent a relation between the token supply and price. Standard bonding curves present in constant product market makers such as Uniswap incur quite a lot of slippage as the size of a trade increases in relation to the size of the pool. The Curve Protocol was created to accommodate this problem. The Curve pools are able to provide lower slippage as they consist of assets that should have a very similar price, for example, stable coins like USDC and USDT or different flavours of Bitcoin such as wBTC and renBTC.

Bancor V2, thanks to the integration with price oracles, can provide more efficient bonding curves even for pools where the price of one asset is volatile in relation to the other asset. Bancor V2 bonding curves, even though not exactly as efficient as Curve’s bonding curves for stable assets, are still quite impressive and they provide less slippage and better capital efficiency. According to the Bancor Team, the new DAMM pool can provide similar slippage to the standard liquidity pools with 20x less capital in the pool.

Opportunity Cost of Providing Liquidity

To address the opportunity cost of providing liquidity, Bancor V2 enables the creation of DAMMs that are integrated with lending protocols such as Aave. Essentially, a part of staked liquidity in the pool can be simultaneously lent out which allows liquidity providers to generate lending interest on top of trading fees and maximize their profitability.

Summary

These are pretty much all the new features of Bancor V2. At the time of writing this article, Bancor started their V2 release by creating a LINK/BNT pool that was, for now, max capped at $500k, so the team can verify if everything works as expected before removing the cap.

One extra thing to add is the fact that a V2 pool can only be created if there is a reliable price oracle for the assets that are traded in the pool. So V2 pools may not be the best choice for unpopular and less liquid tokens.

It’s also worth noting that similarly to Bancor V1, Bancor V2 still relies on having BNT in each liquidity pool. So, for example, to trade from ETH to DAI we would have to trade through ETH/BNT and DAI/BNT pools.

When it comes to competing with other Dexes, Bancor V2 can potentially steal some of Uniswap’s volume especially when it comes to the most popular trading pairs. So far, it doesn’t look like Bancor V2 would be a competitor to Curve as they still provide lower slippage for stable assets, also it’s impossible to create a pool such as USDC/USDT in Bancor V2. Also, V2 pools are limited to only 2 assets so Balancer with multiple assets in one pool still provides a unique value proposition.

So what do you think about Bancor V2? Does it have a chance to dethrone Uniswap and attract more liquidity providers? Share your thoughts below.

If you enjoyed reading this article you can also check out Finematics on Youtube and Twitter.

]]>
https://finematics.com/bancor-v2-explained/feed/ 0