Impermanent Loss

Definition

The loss in value of a liquidity pool contribution relative to the value of the tokens if held outside of the liquidity pool. Impermanent loss occurs when two tokens in a liquidity pool diverge in price and goes away if those tokens return to their original values. Impermanent loss does not necessarily imply a loss in net worth; rather, it objectively measures the disadvantage of holding your tokens in a liquidity pool versus holding the tokens in your wallet.

All you need to know

You might be at a disadvantage when you contribute your tokens to a liquidity pool compared to holding the tokens outright. Yield farmers hope that the fees they earn through the liquidity pool are greater than their impermanent loss.

Key Points Summary

To summarize, here is impermanent loss explained in five bullet points:
  • Golden Rule: Based on the algorithms that govern the liquidity pool, you will always become less exposed to the better performing token. This results in impermanent loss.
  • Impermanent loss impacts a yield farming position whenever the underlying tokens diverge in price. It can impact you when your tokens increase in value and it can impact you when your tokens decrease in value.
  • If impermanent loss outweighs the fees gained by your yield farming position, you are at a disadvantage holding your tokens in a liquidity pool instead of holding the tokens outside of the liquidity pool.
  • If the impact of impermanent loss does not outweigh the fees earned by a yield farming position, you are at an advantage holding your tokens in the liquidity pool instead of holding the tokens outside of the liquidity pool.
Impermanent loss does not imply that you have lost money. If your tokens increase in value, you can make money and be impacted by impermanent loss. This is why we refer to impermanent loss as a disadvantage rather than an actual loss of funds.

All the Rest

Have you ever joined a liquidity pool and come to find out you have less of a token you contributed than you did before? Have you ever compared your gains to a friend who holds the tokens in their wallet instead of a liquidity pool and realized they are outpacing you? These situations occur because of the rules of the decentralized exchange and result in impermanent loss.
Suppose you contribute Token A and Token B to a liquidity pool. The decentralized exchange (DEX) is permitted to trade your tokens to maintain a balance in the liquidity pool that reflects the demand for each of the two tokens. This happens when the two tokens diverge in price. When Token A increases in price compared to Token B, the DEX will sell Token A and buy Token B. This gets us to the golden rule of impermanent loss: Based on the algorithms that govern the liquidity pool, you will always become less exposed to the better performing token. Therefore, you are at a disadvantage in the liquidity pool versus holding the tokens by themselves.
Why does this happen? When you contribute to a liquidity pool, you commit your tokens to the rules of the DEX. This includes the fact that the DEX will alter your ratio of tokens to maintain a constant product of the two tokens.
We can express this mathematically as:
k = (T_a)(T_b)
where k is a constant equal to the product of the supplies of token a (T_a) and token b (T_b).
Impermanent loss is a result of the automated market-maker (AMM) algorithm that enables liquidity pools to set “prices” for token swaps. This is a fancy way of saying that the DEX relies on a balance of tokens to set the price on the exchange. When the demand for one token increases more than the other, your ratio of tokens changes.
The DEX sets prices using an equation that is just as straightforward. The price of Token A (P_a) is given by the ratio of the supply of Token B to Token A:
P_a = T_b / T_a
or in a friendlier format:
Therefore, when Token A becomes more valuable, that means there is less supply of Token A and more supply Token B in the liquidity pool. Again, the liquidity pool will swap your tokens to make this happen. Impermanent loss will hinder your gains, but you should remember that you are collecting fees from the DEX the whole time. If you believe the fees will be worth the disadvantages of impermanent loss, you should consider liquidity pools as a method of diversifying your investment strategy. If you believe the impermanent loss will be greater than the fees gained through the liquidity pool, you might want to consider single-sided staking or holding the tokens outright, instead. Take a look at the examples below that show the impact of impermanent loss on your liquidity pool contribution.
We will start with a $1000 liquidity pool in each example and assume that Token A has a price equal to $0.25 and Token B has a price equal to $0.10. To make a $1000 liquidity pool, you contribute 2000 Token A and 5000 Token B. Let’s see what happens when the prices change.
Example 1: Token A skyrockets to $1.50, while Token B remains constant at $0.10. As Token A increases in value, the DEX will swap some of your Token A for Token B. You will end up with 816.50 Token A and 12247.45 Token B. You have less than half of our original Token A! If you had held the tokens without contributing them into the liquidity pool, you would have $3500. Instead, you have $2449.49 in total value. Is this the end of the world? No, you have over twice the amount that your originally had plus all the fees you would have collected during this time frame. However, it is said that your impermanent loss is about 30% because impermanent loss is technically a measurement of the disadvantage of holding your tokens in a liquidity pool.
Example 2: Token A plummets from the original $0.25 to $0.05. Again, Token B remains the same. You will end up with 4472.14 Token A and 2236.07 Token B, valued at $446.21. You are losing value due to the depreciation of Token A’s price but you are actually losing more than if you were holding the tokens. This is because you are suffering an additional ~25% impermanent loss in addition to the depreciation of the token. If you had held the tokens outside of the liquidity pool, you would have $600.
Example 3: In one year from now, the token prices have not changed at all. You experience 0 impermanent loss and you collect a year’s worth of fees. You were at an advantage holding your tokens in the liquidity pool.