Divegence Loss(Impermenet Loss) of DeFi

in crypto •  2 years ago 

Impermanent loss describes the losses liquidity providers of DEX experience due to price divergence
The word “impermanent” was chosen because the loss due to price divergence may be reversed if the price divergence is also reversed.
However, the use of this term could create the expectation that losses are guaranteed to be reversed, which is not the case. So, divergence loss may be more accurate word to decribe the loss.

DEX

It’s built on a beautifully simple concept whereby liquidity for exchange transactions is provided in the form of on-chain pools, equal in value for both ETH, SOL, USDC and a single ERC-20, SPL or other chain token traded.
Trades are executed against these on-chain pools, which use an automated market making strategy to enable exchange free of order books or additional counterparties.

Divergence Loss

To understand why the value of a liquidity provider’s stake can go down despite income from fees, we need to look a bit more closely at the formula used by Uniswap and most following DEXs to govern trading.
The formula really is very simple. If we neglect trading fees, we have the following:

eth_liquidity_pool * token_liquidity_pool = constant_product
(or in solana case, sol_liquidity_pool * token_liquidity_pool = constant_product)

In other words, the number of tokens a trader receives for their ETH, SOL and vice versa is calculated such that after the trade, the product of the two liquidity pools is the same as it was before the trade. The consequence of this formula is that for trades which are very small in value compared to the size of the liquidity pool we have:

eth_price = token_liquidity_pool / eth_liquidity_pool
Combining these two equations, we can work out the size of each liquidity pool at any given price, assuming constant total liquidity:

eth_liquidity_pool = sqrt(constant_product / eth_price)
token_liquidity_pool = sqrt(constant_product * eth_price)

So let’s look at the impact of a price change on a liquidity provider. To keep things simple, let’s imagine our liquidity provider supplies 1 ETH and 100 DAI to the Uniswap DAI exchange, giving them 1% of a liquidity pool which contains 100 ETH and 10,000 DAI. This implies a price of 1 ETH = 100 DAI. Still neglecting fees, let’s imagine that after some trading, the price has changed; 1 ETH is now worth 120 DAI. What is the new value of the liquidity provider’s stake? Plugging the numbers into the formulae above, we have:

eth_liquidity_pool = 91.2871
dai_liquidity_pool = 10954.4511

Since our liquidity provider has 1% of the liquidity tokens, this means they can now claim 0.9129 ETH and 109.54 DAI from the liquidity pool. But since DAI is approximately equivalent to USD, we might prefer to convert the entire amount into DAI to understand the overall impact of the price change. At the current price then, our liquidity is worth a total of 219.09 DAI. What if the liquidity provider had just held onto their original 1 ETH and 100 DAI? Well, now we can easily see that, at the new price, the total value would be 220 DAI. So our liquidity provider lost out by 0.91 DAI by providing liquidity to DEX instead of just holding onto their initial ETH and DAI.

Of course, if the price were to return to the same value as when the liquidity provider added their liquidity, this loss would disappear.
This loss is only realised when the liquidity provider withdraws their liquidity, and is based on the divergence in price between deposit and withdrawal. We can therefore call it divergence loss (previously described as impermanent loss).

Using the equations above, we can derive a formula for the size of the divergence loss in terms of the price ratio between when liquidity was supplied and now. We get the following:

divergence_loss = 2 * sqrt(price_ratio) / (1+price_ratio) — 1
Which we can plot out to get a general sense of the scale of the divergence loss at different price ratios

Source: Orca.so, Uniswap.org

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!
Sort Order:  

Hello @harryji
Thank you for sharing such great content!
PLEASE KINDLY CLICK HERE TO VOTE US AS BLURT WITNESSBlurt to the moon 🌕You can delegate any amount of Blurt power to @blurtconnect-ng
This post has been upvoted manually by @chibuzorwisdomblurtconnect.gifUse #blurtconnect tag to get more upvotes from us

Also, keep in touch with Blurtconnect-ng family on Telegram and Whatsapp