Article source: https://finematics.com/impermanent-loss-explained/
In essence, impermanent loss is a temporary loss of funds occurring when providing liquidity. It’s very often explained as a difference between holding an asset versus providing liquidity in that asset. Impermanent loss is usually observed in standard liquidity pools where the liquidity provider (LP) has to provide both assets in a correct ratio, and one of the assets is volatile in relation to the other, for example, in a Uniswap DAI/ETH 50/50 liquidity pool.
If ETH goes up in value, the pool has to rely on arbitrageurs continually ensuring that the pool price reflects the real-world price to maintain the same value of both tokens in the pool. This basically leads to a situation where part of the profit from the token that appreciated in value is taken away from the liquidity provider. At this point, if the LP decides to withdraw their liquidity, the impermanent loss becomes permanent.
Example
The easiest way to fully understand impermanent loss is to go through a quick example.
Let’s assume an LP provides liquidity to a DAI/ETH Uniswap 50/50 pool. To supply liquidity to a 50/50 pool, the LP has to provide an equal value of both tokens to the pool.
So far, so good, the value of both tokens is the same.
The price of ETH goes up on an external venue such as Coinbase. Now Coinbase’s ETH price is $550. This is where other market participants, called arbitrageurs, come into play. An arbitrageur notices the price difference between Coinbase and Uniswap and sees that as an opportunity for arbitrage that is basically an opportunity to make a profit.
Uniswap uses a constant product market maker to maintain a correct ratio of tokens in the pool. So as more ETH is being bought from the pool, the higher the price of ETH becomes. The arbitrageur buys cheaper ETH on Uniswap until there is no more price discrepancy between the exchanges. Let’s see how much ETH the arbitrageur has to buy to make this happen.
By plugging our external (Coinbase) price into a few formulas that can be derived from the constant product market maker formula, we can see that the point where the Uniswap ETH price will be at $550 is when there are 10,488.09 DAI and 19.07 ETH in the pool. So the arbitrageur is basically able to buy 0.93 ETH in order to achieve equilibrium between Uniswap’s and Coinbase’s ETH price, costing 488.09 DAI and achieving the average price of 524.83 DAI per ETH. Bought ETH can be instantly sold for DAI or any other USD based stable coin on an external venue for $550. The arbitrageur just earned ~25USD minus the fees.
Let’s see how this affected our liquidity provider.
As we can see the LP would’ve had $23.41 more if they just held their assets without providing liquidity. That $23.41 is basically the LPs impermanent loss.
Impermanent loss is called impermanent because at this point the LP lost $23.41 only on paper. If the LP doesn’t withdraw their liquidity and the price of ETH goes back to $500, the impermanent loss is cancelled back to 0. On the other hand, if the LP decided to withdraw their liquidity, they would realise their loss of $23.41, permanently.
LPs profit
Ok, now that we understand what impermanent loss is, let’s see how it can take away LPs profit as the value of one asset increases in relation to the other.
We can see that, for example, if the price of the asset in the pool goes up by 500% the LPs would experience a 25% impermanent loss. Here is the link to the article with the chart and other useful calculations.
So if impermanent loss can take away so much profit, what is the incentive for liquidity providers to provide liquidity in the first place? To understand that, let’s see how LPs can make money on their capital.
In the perfect world with no impermanent loss, the LPs would just be collecting money from trading fees. For example when it comes to Uniswap, each trade that goes through a liquidity pool pays a 0.3% fee that is proportionally distributed to the LPs of that pool.
This basically means that the LP can still make money even when experiencing impermanent loss under the condition that impermanent loss < collected fees.
On top of that, a lot of liquidity pools provide additional incentives for LPs by offering liquidity mining programs. Liquidity mining, in essence, is a way of rewarding LPs with extra tokens for providing liquidity to certain pools or using a protocol. The value of the additional tokens in some cases can completely negate the value lost by impermanent loss, making providing liquidity highly lucrative.