Impermanent loss in Decentralized Finance I volatility in a trading pair

Gepubliceerd op 24 oktober 2021 om 11:57

In this blog, I discuss the phenomenon of impermanent loss. One of the risks of providing liquidity in a liquidity pool is permanent loss. In my previous blog, I wrote a blog post about liquidity pools. In this post I will not discuss liquidity pools. I refer to my blog post ''Liquidity pools I to facilitate efficient asset trading'' for more information on liquidity pools.


What is impermanent loss?

Impermanent loss occurs when a user holding cryptocurrency provides liquidity to a liquidity pool, and the price of the provided crypto changes compared to the moment you provided your cryptocurrency in a liquidity pool. The bigger this change (delta) is, the more likely it is that a temporary loss will occur. In this case, the loss means a lower dollar value (or any other value to which the crypto is linked) at the time of the withdrawal of the provided crypto than at the time of providing the crypto in a liquidity pool.

Liquidity pools where the value fluctuates less, the chance of an impermanent loss will be less likely to occur. An example where the chance of an impermanent loss will be less likely to occur is stablecoins. In the case of stablecoins, the value will decrease less quickly by say, 70%, as a result of which a potential impermanent loss will be less likely to occur.

Why still providing cryptocurrency in a liquidity pool when impermanent losses can occur?

A temporary loss can be offset by trading fees. Even if a particular trading pair is subject to an impermanent loss, it can still be advantageous to provide your cryptocurrency in a liquidity pool.

Certain Decentralized Exchanges charge a certain percentage that goes to the liquidity providers. Suppose this is 0,3% per trade. If the volume in a liquidity is high and there are many trades on a Decentralized Exchange, providing cryptocurrencies in a liquidity pool can still be advantageous. Even if this liquidity pool is subject to impermanent loss.

When does an impermanent loss occur?

Example: 

  • Alice wishes to provide liquidity into the ETH:DAI liquidity pool on a Decentralized Exchange (for example SushiSwap).
  • The current price of 1 ETH is $100. DAI is a USD stablecoin. That means that 1 DAI equals $1. The ratio of the liquidity pool must be balanced in a 50:50 ratio.
  • The ratio of the liquidity pool must be balanced (50:50), so Alice deposits 1 ETH and 100 DAI into the liquidity pool.
  • This means that the price of 1 ETH is 100 DAI at the time of deposit. The total investment of Alice is $200 (1 ETH is $100 and 100 DAI is $100 because 1 DAI is $1).
  • Assume that there is in total 10 ETH and 1,000 DAI in the liquidity pool funded by other liquidity providers (LPs) like Alice. The total liquidity in this pool is $10,000 (10*1,000). Alice holds a share of 10% in the total liquidity pool: 10 ETH equals 10*100 = $1,000. Alice has 1 ETH. That means that Alice has 100/1000 = 10% share in ETH. 1,000 DAI equals $1,000 because 1 DAI is $1. Alice has 100 DAI that equals $100. Alice has a 100/1,000 = 10% share in DAI. 
  • After a week, the price changes drastically. The price of 1 ETH is now $200 (or 200 DAI; trading pair is ETH:DAI) instead of $100 (or 100 DAI). Arbitrage traders will add DAI to the pool and remove ETH from the liquidity pool until the ratio reflects the current price. Remember, AMMs don’t have order books! The ratio between the two cryptocurrencies determines the price of the assets in the pool. While liquidity remains constant in the liquidity pool ($10,000), the ratio of the assets (ETH and DAI) changes. 
  • Arbitrage traders buy ETH from the liquidity pool that is now 50% cheaper than the real-world market price: liquidity pool price is $100 and the real-world market price is $200. This leads to a decrease of the amount of ETH and an increase of the amount of DAI. This process continues until 1 ETH equals $200 DAI. 
  • There is now a new distribution of ETH and DAI in the liquidity pool. One that can be calculated via the following formula: x = √k/r and y=√k*r.
  • x = ETH, y = DAI, k = $10,000 (total liquidity) and r is 200 (1 ETH = 200 DAI). The new distribution of each asset can then be calculated using the formulas: ETH= √10,000/200 = 7.07 and DAI = √10,000*200 = 1,414.21. 

  • After the arbitrage process has completed, there are just over 7 ETH and around 1,414 DAI in the liquidity pool. 
  • Alice has a 10% share in the liquidity pool. If Alice wishes to withdraw her share, she can withdraw 0.707 ETH (10% * 7,07) and 141.42 DAI (10% * 1,414.21). At the new market price of $200, this equals to $282,82 (0,707*200 + 141,42). Alice has gained $82,82 compared to her initial investment of $200. Pretty sweet right? 
  • However.... if Alice did not provide her ETH and DAI into a liquidity pool but left her crypto in a crypto wallet, the value of her assets would be $300 (1 ETH * $200 + 100 DAI * $1). 
  • The impermanent loss for Alice can be calculated by subtracting $282,82 from $300. The impermanent loss would be $17.17.  
  • The conclusion in this example is that keeping crypto in a wallet was a better option than providing crypto in a liquidity pool. This is exactly what impermanent loss is: the difference between providing liquidity (crypto) in a DEX (AMM) and holding the crypto in a wallet.

How to mitigate impermanent losses?

  • Trading fees: temporary losses can offset trading fees.
  • Low volatility trading pairs: impermanent loss can be mitigated by choosing a cryptocurrency trading pair where the exchange price is not volatile. For example stablecoins.
  • Exchanges with a ratio other than 50:50: price changes in pools that have a higher ratio, such as 80:20 do not result in as much impermanent loss when compared with liquidity pools that have a 50:50 ratio.
  • Liquidity pools where you can deposit one side of the trading pair: Impermanent loss occurs (in a standard liquidity pool) where 2 different crypto assets must be deposited (in the previous example ETH and DAI). Some exchanges have developed liquidity pools that offer liquidity providers the opportunity to provide only one side of the trading pair. For example the trading pool ETH:DAI. If an user only has to provide one side of the liquidity pool (for example ETH), the risk of impermanent loss is mitigated drastically.

Last remarks

The loss is ''impermanent'' because prices could return to the initial exchange price. If the price returns to the initial exchange price, no impermanent loss exist. The loss is ''permanent'' if - Alice in our example - withdraws her assets from the liquidity pool. 

For first time liquidity providers, a tip is to stay with low volatility trading pairs or stablecoins. In that way, impermanent loss is mitigated as much as possible.

This article was written on August 30, 2021.

BTC address: bc1q3nnm8m2vrsv8med8a38dl37g8l3mm4wa7ph7wj 

ETH address: 0x38b84E2D3B50F83A067A7488C1733180651f418A

Reactie plaatsen

Reacties

Er zijn geen reacties geplaatst.