The concept of Concentrated Liquidity: Uniswap V3
Uniswap V1 & V2 allowed liquidity providers to supply liquidity for the whole price spectrum but what if you can provide liquidity in the specific price range? How will it change the things?
Referencing my previous article, you probably have a decent understanding of the working of DEXs.
Here is a TL;DR of my last article on DEXs
DEXs create a win-win-win scenario between a newly launched protocol, liquidity providers, and traders.
Liquidity providers gain rewards for supplying liquidity; Protocols gain more and more liquidity for their token, thus more room to scale; Traders can get their hands on their favorite tokens in the easiest way possible.
DEXs like Uniswap work on a constant product function
Swap fees collected from the traders are re-supplied as liquidity in the pool itself.
Higher the liquidity, the lesser the slippage.
Liquidity of volatile assets > high risk of impermanent loss > high incentives.
When someone provides liquidity to a pool, the liquidity is spread towards the whole spectrum of prices.
When the relative price of the assets in the pool doesn't change much, very less liquidity is effectively used.
Here is what Uniswap has to say regarding a stable-coin pair liquidity pool:
The liquidity outside the typical price range of a stable-coin pair is rarely touched. For example, the v2 DAI/USDC pair utilizes ~0.50% of the total available capital for trading between $0.99 and $1.01, the price range in which LPs would expect to see the most volume - and consequently earn the most fees.
How come most assets are never touched?
Imagine 100s of small pools within this price spectrum of a liquidity pair (the above visual can be considered). Of those 100s of small pools, only one pool is active at a time depending on the current exchange price.
Is there any way we can utilize the full liquidity rather than just a small portion?
Uniswap V3 solves this via the concept of Concentrated Liquidity.
Instead of me bombarding information on you have a look at the visual below. $FTM/$ETH liquidity pool is chosen to provide liquidity worth $1000.
Here is a scene before the concept of concentrated liquidity got introduced. As the liquidity is spread across 0 to infinity, (only a portion around the price) is efficient thus rewards will be on the lesser side (1.49% monthly APR making it 18.13% yearly).
After concentrating liquidity near the probable price range, your rewards will look like this:
Here, you are providing liquidity within the price range of $2501.732 to $4125.173. You can observe that rewards are significantly increased (13.04% monthly APR making it 158.65% yearly).
What if you narrow down the price range for your liquidity?
Here, you narrowed the price range i.e. $3356.791 to $4125.173. You can observe that rewards are way higher than before(29.64% monthly APR making it 360.67% yearly).
Uniswap V3 allows liquidity providers to choose a price range for the deployment of their liquidity. By concentrating their liquidity, liquidity providers can provide the same liquidity depth as earlier within specified price ranges while putting far less capital at risk.
If market prices move outside a liquidity provider's specified price range, their liquidity can be theoretically assumed to be removed from the pool and is no longer earning fees.
Here is a comparison of all 3 cases discussed above:
You know rewards are proportional to risks and here rewards are getting higher and higher but at what cost?
Higher risk of Impermanent Loss.
Let’s approach this with an example:
You want to provide liquidity worth $40,000 in the pair $ABC/ $XYZ where $ABC = $1; $XYZ = $20,000; making the current exchange price of $20,000.
What if $XYZ hits $40,000?
Impermanent Loss from Uniswap V2: 5.72%
When liquidity is spread through the whole price spectrum, your supplied assets will never get converted fully into one of the assets from the pool.
This feature ensures there are always two assets in the pool and are exposed to the price appreciation or depression always.
Impermanent Loss from Uniswap V2: 21.6%
When you supplied liquidity to the pair $ABC/ $XYZ for the price range of $10,000 - $30,000 and current trading price is at $20,000 while providing liquidity, the flattening of green shaded portion exactly depicts how your entire capital ($40,000) will be reflected in one asset i.e. $ABC If the price of $XYZ gets to $40,000.
Concluding this article with an application of what I explained: You can use the above concept to create a traditional limit order, Uniswap calls this a Range Order.
For example, if the current price of $DAI is below $1.001 $USDC, you could add $10m worth of $DAI to the range of $1.001 — $1.002 $DAI/$USDC.
Once $DAI trades above $1.002 $DAI/$USDC, your liquidity will have fully converted into $USDC. You must withdraw your liquidity (or use a third-party service to withdraw on her behalf) to avoid automatically converting back into $DAI if $DAI/$USDC starts trading below $1.002.
One more thing I forgot to explain is LP tokens
As you know, in Uniswap V1 & V2, liquidity providers get liquidity tokens (LP tokens of farm tokens) pro-rata to the liquidity supplied and every LP token is similar to other LP tokens of the same pool i.e. fungible.
In Uniswap V3, liquidity positions are no longer fungible due to the variability in the price range from every liquidity provider. These LP tokens are not represented as ERC20 tokens in the core protocol.
Instead, LP positions are represented by non-fungible tokens (NFTs). However, commonly shared positions can be made fungible (ERC20).