Uniswap v2
Uniswap v2 used a uniform liquidity distribution model, where liquidity was distributed evenly across all price ranges. This meant that a significant amount of capital was locked up in inactive areas of the price curve, reducing capital utilization and potentially decreasing returns for liquidity providers.
Constant Product AMM
Uniswap uses a constant product function to determine the prices of different cryptocurrencies. It’s like a see-saw that keeps everything balanced. This approach is summarized by the equation x*y=k, where x is the amount of token A, y is the amount of token B, and k is a constant number.The x*y=k curve is a formula that states that the product of the two reserve balances in a liquidity pool must always be equal to a constant value, k.
This means that if the price of one token in the pool increases, the amount of that token in the pool will decrease, and vice versa. This ensures that there is always enough liquidity available at all prices, regardless of how the price of the tokens changes.
The amount of Token A and Token B in the pool always has to multiply to the same number. So, if you have more of Token A, you’ll have less of Token B to keep the equation balanced.
Anyone can become a liquidity provider by putting an equal value of Token A and Token B into the pool. In return, they receive pool tokens that represent their share of the total pool. These tokens can be redeemed for the actual tokens whenever they want.
Let’s take an example.
There’s a pool with 1,000 ETH and 1,000,000 USDC. Initially, the price of 1 ETH is $1000, and the equation’s constant product is 1,000,000,000 (1,000 * 1,000,000 = 1,000,000,000).
Now, imagine someone who wants to trade 5 ETH for USDC. When they take out 5 ETH from the pool, there will be 995 ETH left. To keep the equation balanced, they need to deposit some USDC into the pool. In this case, they would need to deposit around $5,025.13 worth of USDC, so the total amount of USDC in the pool becomes 1,005,025.13.
The equation still holds 995 * 1,005,025.13 = 1,000,000,000.
But because the ratio of ETH to USDC in the pool has changed, the new implied price for 1 ETH would be $1,005.03. The price gets normalized later through arbitrage.
This system ensures that Uniswap prices always move towards the prices on other exchanges, preventing big differences and allowing people to make easy and fair trades.
Uniswap v2 distributes liquidity evenly along the x*y=k curve by using a mathematical algorithm to determine how much of each token in the pool should be available at each price.
Liquidity Provision on Uniswap v2
As an investor, you can participate in the Uniswap liquidity pool by lending your assets, such as USDC or Ethereum, to the pool. This means that you are essentially providing a loan to the pool, which will then use your assets to facilitate trades between other users. In return for lending your assets, you will earn a portion of the fees that are collected from these trades.
However, liquidity was spread evenly across the entire price range, from zero to infinity. This meant that even if a particular price range was rarely traded, LPs would still have their assets allocated there, potentially earning fewer fees.
Example:
Let's consider a scenario where a liquidity provider (LP) contributes 1,000 USDC to a Uniswap v2 pool that initially has 1,000 ETH and 1,000,000 USDC. The price of 1 ETH is $1,000, and the constant product of the pool is 1,000,000,000 (1,000 ETH * 1,000,000 USDC = 1,000,000,000).
When the LP contributes 1,000 USDC, they receive a corresponding amount of liquidity pool tokens (LPTs). These LPTs represent their share of the pool's assets and entitle them to a portion of the trading fees generated by the pool.
Now, let's assume that a trade occurs in the pool, and 100 ETH is swapped for USDC. This trade will change the relative amounts of ETH and USDC in the pool, and it will also generate a trading fee of 0.3% of the trade amount (300 USDC).
The LP's share of this trading fee will be proportional to their share of the pool's liquidity. Since they contributed 1,000 USDC to the pool, which represents 0.1% of the pool's total liquidity (1,000 USDC / 1,000,000 USDC = 0.1%), they will receive 0.1% of the trading fee (300 USDC * 0.1% = 0.3 USDC).
Therefore, the LP will earn 0.3 USDC from this trade in Uniswap v2.
Uniform Liquidity Distribution and Capital Inefficiency
In Uniswap v2, liquidity providers contributed their assets to a pool, and the pool's reserves were distributed evenly across all possible price ranges. This meant that a significant amount of capital was allocated to areas of the price curve where trading was unlikely to occur, especially for stablecoin pairs where prices remained relatively stable.
As a result, liquidity providers' capital was not being used efficiently. A large portion of their funds was essentially idle, generating little to no returns. This underutilization of capital reduced the overall profitability of liquidity provision on Uniswap v2.
In Uniswap v2, liquidity providers deposited their assets into a pool, and the pool's reserves were distributed evenly across all possible price ranges. This means that for any given pair of assets, the pool held a certain amount of each asset at every possible price point.
For example, if you were to deposit liquidity into a DAI/ETH pool on Uniswap v2, your contribution would be added to the pool's reserves at both the current market price of DAI/ETH and at all other possible price points. This uniform distribution of liquidity across the entire price curve ensured that there was always liquidity available for trades at any price.
Impact on Liquidity Provider Returns
Capital inefficiency directly impacted the returns earned by liquidity providers. Since a significant portion of their capital was not actively generating fees, their overall return on investment (ROI) was lower than it could have been.
Moreover, the uniform liquidity distribution model meant that liquidity providers were exposed to price fluctuations across the entire price range. This increased their risk of impermanent loss, which occurs when the prices of the assets in a pool diverge, causing the value of the liquidity provider's holdings to decrease temporarily.
Uniswap v3's Concentrated Liquidity as a Solution
To address the issues of capital inefficiency and impermanent loss, Uniswap v3 introduced concentrated liquidity. This innovative mechanism allows liquidity providers to focus their liquidity within specific price ranges, rather than distributing it evenly across the entire price curve.
By concentrating liquidity around price ranges where trading is most likely to occur, liquidity providers can utilize their capital more efficiently and reduce their exposure to impermanent loss. This leads to potentially higher returns and improved risk management for liquidity providers.
In summary, Uniswap v2's uniform liquidity distribution model resulted in capital inefficiency and reduced returns for liquidity providers. Concentrated liquidity, introduced in Uniswap v3, aims to address these issues by allowing liquidity providers to focus their capital on relevant price ranges, improving capital utilization and mitigating impermanent loss.
Capital Inefficiency of Uniform Liquidity Distribution
While Uniswap v2's uniform liquidity distribution model ensured ample liquidity for trades, it also led to capital inefficiency. A significant portion of liquidity was allocated to areas of the price curve where trading was unlikely to occur, especially for stablecoin pairs where prices remained relatively stable.
For instance, in a stablecoin pair like DAI/USDC, the price typically fluctuates within a narrow range, such as between $0.99 and $1.01. Under Uniswap v2's uniform distribution, a substantial amount of liquidity would be allocated to price points outside this range, where trading activity was minimal.
This inefficient allocation of capital reduced the overall profitability of liquidity provision on Uniswap v2. Liquidity providers' funds were not being used effectively, leading to lower returns on their investment.
Scenario:
Consider a DAI/ETH pool on Uniswap v2 with the following initial reserves:
Reserve of DAI = 10,000 DAI
Reserve of ETH = 100 ETH
The pool price is initially 100 DAI per ETH.
A liquidity provider (LP) decides to contribute 1,000 DAI to the pool.
Calculating Pool Tokens Received:
Using the formula for pool tokens received:
Pool Tokens Received = (Value of Contribution) / (Total Pool Value)Pool Tokens Received = (1,000 DAI) / (10,000 DAI + 100 ETH * 100 DAI/ETH) = 100 pool tokensThe LP receives 100 pool tokens, representing their share of the pool's assets.
Calculating LP Returns:
Assume the following events occur:
Price Increase: The price of ETH rises to 120 DAI per ETH.
Trading Volume: There is a total trading volume of 1,000 DAI worth of ETH trades within the LP's chosen price range.
Fee Rate: The fee rate for the pool is set at 0.3%.
Calculating Fees Earned:
Using the formula for fees earned:
Fees Earned = (Total Trading Volume) * (Fee Rate)Fees Earned = (1,000 DAI) * (0.3%) = 3 DAIThe LP earns 3 DAI in fees from trades that occurred within their chosen price range.
Calculating Impermanent Loss:
Due to the price increase, the LP's impermanent loss can be calculated using the following formula:
Impermanent Loss = (Current Pool Price - Initial Pool Price) * (LP's Share of Pool)Impermanent Loss = (120 DAI/ETH - 100 DAI/ETH) * (100 pool tokens / 1,100 pool tokens) = 18.18 DAIThe LP experiences an impermanent loss of 18.18 DAI due to the price divergence.
Calculating Net Returns:
To calculate the LP's net returns, we combine the fees earned and the impermanent loss:
Net Returns = Fees Earned - Impermanent LossNet Returns = 3 DAI - 18.18 DAI = -15.18 DAIIn this scenario, the LP experiences a negative return of 15.18 DAI due to the impermanent loss outweighing the fees earned.
Factors Affecting LP Returns:
LP returns are influenced by various factors, including:
Trading Volume: Higher trading volume generally leads to higher fee earnings.
Fee Rate: A higher fee rate increases the fees earned per trade.
Price Volatility: Impermanent loss is more significant when price volatility is high.
LP's Chosen Price Range: Carefully selecting price ranges can help mitigate impermanent loss.
Impermanent Loss
Furthermore, the uniform liquidity distribution model exposed liquidity providers to the risk of impermanent loss. Impermanent loss occurs when the prices of the assets in a pool diverge, causing the value of the liquidity provider's holdings to decrease temporarily.
In the case of a stablecoin pair like DAI/USDC, impermanent loss could occur if the price of DAI temporarily increased relative to USDC. This would cause the value of the DAI/USDC liquidity provider's holdings to decrease, even though the total value of their assets (DAI and USDC) remained constant.
Concentrated Liquidity in Uniswap v3
To address the issues of capital inefficiency and impermanent loss, Uniswap v3 introduced concentrated liquidity. This innovative mechanism allows liquidity providers to focus their liquidity within specific price ranges, rather than distributing it evenly across the entire price curve.
Liquidity providers can choose to provide liquidity for specific price intervals, known as ticks. When a trade occurs within a price range where liquidity is concentrated, the liquidity provider earns fees from that trade. Conversely, if a trade occurs outside of their chosen price range, they do not earn any fees.
Advantages of Concentrated Liquidity
Concentrated liquidity offers several advantages over Uniswap v2's uniform distribution model:
Capital Efficiency: By focusing liquidity on relevant price ranges, liquidity providers can utilize their capital more efficiently, leading to potentially higher returns.
Impermanent Loss Mitigation: Concentrated liquidity can mitigate impermanent loss by reducing exposure to price fluctuations outside of the chosen price range.
Active Tick Selection: Liquidity providers can actively select the price ranges where they want to provide liquidity, giving them greater control over their risk management.
Fee Flexibility: Uniswap v3 offers multiple fee tiers, allowing liquidity providers to choose the fee level that best suits their risk tolerance and return expectations.
Overall, concentrated liquidity is a significant improvement over Uniswap v2's uniform distribution model. By allowing liquidity providers to focus their capital on relevant price ranges, it improves capital utilization, mitigates impermanent loss, and provides greater flexibility for liquidity providers to manage their risks and returns.
Last updated