first level title
AMM overview
To understand the decentralized finance innovation that Curve brings to the table, it is first necessary to understand some Automated Market Maker (AMM) basics, let’s quickly recap:
AMM consists of three main branches:
Liquidity pool composed of token pairs
A constant mathematical formula used to determine the pricing of tokens in the liquidity pool
And, while not technically part of the protocol, AMMs rely heavily on cryptocurrency traders buying and selling tokens in liquidity pools, which helps keep token prices in those pools in line with the broader cryptocurrency market.
impermanent loss
impermanent loss
The most basic AMM model maintains a constant product formula to manage a collection containing two different assets with the same monetary value. For example, suppose an AMM’s liquidity pool holds two assets, ETH and BTC, whose historical prices have fluctuated widely. When the liquidity pool was first created, 50% of the total pool value was in BTC and 50% in ETH, but as traders interacted with the pool, the balance of value between BTC and ETH changed. The asset pool is constantly trying to rebalance itself to equal monetary value in BTC and ETH by changing asset prices.
Arbitrageurs take advantage of price differences when there is a significant change in the price of ETH or BTC on other exchanges, but not in the liquidity pool. For example, if the price of BTC has dropped significantly in other markets, but not yet in the liquidity pool, arbitrageurs can step in and start selling BTC to the pool at a price above the market. This arbitrage process plays a vital role for AMMs by resolving key price discrepancies between liquidity pools and other exchanges.
While arbitrageurs benefit from price differentials, liquidity providers lose out. Liquidity providers would have been more profitable by not using the pool at all if the price in the pool was too far from the price at pool launch. This situation where the price difference causes the condition of the liquidity provider to deteriorate is called "permanent loss". Liquidity providers will be more profitable if they maintain the same balanced portfolio but keep their tokens out of the liquidity pool. The reason why this "loss" is considered "impermanent" is that the value of the token balance in the liquidity pool may eventually recover or even rise.
Let's look at a high-level scenario, assuming you are a liquidity provider providing 5 ETH and 1 BTC to a liquidity pool with equal amounts of ETH and BTC:
1 BTC = 5 ETH when you enter the liquidity pool, but shortly thereafter, on other exchanges outside of your AMM, the price of BTC drops, so 1 BTC = 4 ETH.
Arbitrageurs see an opportunity to profit from the high price of BTC from the pool you just entered. So, for simplicity, they will buy 1 BTC on an external exchange for 4 ETH, then sell 1 BTC to your liquidity pool for 5 ETH, make a profit of 1 ETH, and repeat.
When they sell BTC into your liquidity pool, the price of BTC in your liquidity pool will start to drop as the number of BTC tokens increases and the constant formula keeps adjusting the price of those tokens to maintain the value of all BTC Equal to the value of all ETH. The arbitrageur will continue to sell BTC to your pool until the BTC in your pool matches the market value of BTC, which of course is 4 ETH. So even though the arbitrageurs are all doing 1 ETH on their trades, you just lose 1 ETH worth of value.
The value of tokens in your pool is now worth:
1 BTC(4 ETH)+ 4 ETH = 8 ETH
If you keep 1 BTC and 5 ETH out of the pool, your tokens are worth:
1 BTC(4 ETH)+ 5 ETH = 9 ETH
cost
cost
Slippage
Slippage
first level title
How Curve optimizes AMM
By design, focused on similarly priced assets like AMM stablecoins or tokenized Bitcoin, Curve minimizes impermanent losses, fees and slippage. AMMs like Uniswap have liquidity pools composed of completely different assets such as ETH and BTC, while Curve liquidity pools consist of only stablecoins such as DAI, USDC and USDT, or only wrapped Bitcoin tokens ( such as wBTC and renBTC).
By focusing the design on pools of similar assets, Curve users see several advantages.
First, the risk of permanent loss is greatly reduced. Since the assets in the pool essentially all tend towards the same price, it is very unlikely that the price of any token in the pool will slip too far.
The most important idea in the design is to concentrate most of the liquidity around the ideal price (1.0) of the most needed fixed assets. In this way, liquidity can be utilized more efficiently, facilitating higher exchange volumes even with limited reserves.
Since stablecoin assets are much less volatile, the optimal fees must not be as high as crypto-to-crypto pairs. On Uniswap, the fee per transaction is 0.3%, while on Curve, it is only 0.04%, a difference of almost 10 times. Indeed, if the price fluctuates within +/- 0.1%, for example, a 0.3% fee will not appeal to any rational trader. Another benefit of using similarly priced assets in a single pool is that price volatility remains low even with high trading volumes. We know that high volatility produces large slippage, so low volatility on the Curve results in minimal slippage.
However, these advantages do come with trade-offs. By focusing on pools of similar assets, Curve loses the dynamism and flexibility afforded by AMMs such as Uniswap, a mechanism that allows anyone to create a liquidity pool using any pair of tokens on the planet.
Incentives
If Curve's fees are so low, how are users incentivized to become liquidity providers? The answer is composability - the superpower of the DeFi ecosystem.
Curve pools attract liquidity by combining incentives from other protocols. Assets put into the curve pool are not just sitting idle. They put in the work and got interested in various other DeFi protocols. DAI, USDC, and USDT in Curve are automatically lent to interest-paying borrowers on other platforms such as Compound, Aave, and Synthetix. Curve doesn’t just rely on fees to entice users to provide liquidity, but instead leverages rates and rewards from other protocols. Lower slippage and fees attract traders, while high yields and minimal impermanent losses attract liquidity providers.
What is the best way to interact with the decentralized finance ecosystem? The answer (at least for now) is that there isn't just one best way. The ideal formula might be a combination of different protocols working together in a composable DeFi stack. Curve excels at minimizing fees, slippage and impermanent losses through centralized asset pools, while other AMMs maximize liquidity for various tokens. Users can decide which protocol to use according to their needs.
Uniswap: AMM first march
Another DEX deployed earlier on AMM is Uniswap. Uniswap is the decentralized exchange (DEX) with the largest trading volume and a pioneer of decentralized finance (DeFi). The Uniswap protocol uses AMMs and liquidity pools to facilitate peer-to-peer trading. Liquidity providers add tokens to Uniswap pools and earn fees proportional to their pool share. In September 2020, Uniswap launched the governance token UNI, and airdropped 400 UNI to each platform user, setting off a wave of DEX token airdrops and money distribution.
Uniswap is a decentralized exchange protocol that runs on the Ethereum blockchain. The platform enables peer-to-peer (P2P) transactions to be executed without an order book or intermediary. The Uniswap platform achieves this through a liquidity pool model using automated smart contracts that give would-be traders access to competing user-funded token reserves. Anyone can trade tokens, contribute tokens to pools and earn fees, or list tokens on Uniswap. Almost all ERC-20 tokens can be traded using Uniswap, and there are no listing fees.
In regular markets, an order book compiles open buy and sell orders for any asset.
If there is a large gap between what buyers are willing to pay and what sellers are willing to accept, a lack of trading activity can lead to reduced liquidity, meaning that the asset will be difficult to sell if held. Uniswap pools over 22,000, ensuring liquidity by creating a deep pool of trading assets that minimizes dislocations between buyer and seller market orders. Uniswap's automated market maker technology analyzes liquidity pools algorithmically to provide the most appropriate price for a particular trade.
The key innovation that makes the Uniswap protocol work is Automated Market Maker (AMM) technology. AMMs are smart contracts that manage Uniswap pools that provide tokens to enable transactions. When a trade is made, the AMM algorithm determines the price based on the supply and demand between tokens in these liquidity pools.
When users trade using the Uniswap liquidity pool, a 0.3% transaction fee will be charged. Anyone who contributes to a Uniswap liquidity pool will have these fees reduced proportionally to their share of the overall pool. For example, if the fee charged on a particular market is equal to $100, and the user provides 50% of the liquidity in the pool, he will receive $50. It’s important to note that Uniswap itself pays no transaction fees; instead, profits are only distributed among Uniswap’s community of users.
constant product formula
Each market pair ERC-20 token or liquidity pool (e.g. ETH/DAI) is managed by an AMM that accepts another token by maintaining a "constant product" formula of x*y=k. . In this formula, both x and y are variables, each representing the total value of a token in the market pair, for example x would be the total value of ETH and y would be the total value of DAI in the proposed ETH/DAI liquidity pool. Uniswap multiplies these two numbers to determine k or pool liquidity. A core requirement of Uniswap is that the liquidity of the pool remains constant even if the value of x or y changes.
The result is that every trade affects the price of x and y, but the liquidity remains the same. For example, if a trader buys 1 ETH in exchange for 330 DAI, the ratio of ETH in the liquidity pool will decrease while the ratio of DAI will increase because there is less ETH in the pool and 330 more DAI tokens. As a result, the price of Ethereum will increase, while the price of DAI will decrease. This formula ensures that fair market value is maintained.
Reference:
