What is Impermanent Loss?

Perpetual Protocol
Perpetual Protocol
Published in
6 min readMar 9, 2022

--

If you’ve used DeFi protocols, you may have heard the term impermanent loss (also known as divergence loss), but what exactly does it mean and why should you be aware of it? Read on to find out more!

Liquidity pools enable anyone to become a market maker and earn fees by depositing two assets to a pool. Takers use the pool’s liquidity to open a position and pay a fee, which is split amongst all liquidity providers proportional to the assets they supplied.

While liquidity providers (“LPs” in the following) can earn fees from these pools, the nature of Automated Market Makers (AMMs) means that the pools always sell the outperforming asset and buy the underperforming asset, which gives rise to what is known as Impermanent Loss.

Impermanent Loss Explained

Impermanent Loss (IL) is defined as the difference between locking assets into a liquidity position in an Automated Market Maker (AMM), and the HODL value of the position that was originally contributed. Liquidity providers take on this risk when adding tokens to a pool in order to earn trading fees. When there’s a larger divergence in the prices of the tokens compared to when they were deposited in the pool, the greater your impermanent loss will be.

The term ‘impermanent’ can be misleading since it may suggest that the loss is temporary, but this may not always be the case. If the price divergence is reversed, then the loss is temporary but it is not always guaranteed to be the case. An alternative name for this concept, divergence loss, better describes the situation.

Impermanent loss can happen no matter what direction the market is moving, the key is that the price diverges from the initial price at which you provided liquidity. It’s called IL because the losses only become realized once you withdraw your coins from the liquidity pool. At that point however the losses very much become permanent. The fees you earn may be able to compensate for the losses.

To better understand impermanent loss, let’s look at an example.

Impermanent Loss Example

If the liquidity provider removes their liquidity when all the relative token prices are the same as when they added liquidity, impermanent loss will be zero: they will have exactly the same amount of tokens they’ve invested.

In a traditional AMM, the aggregate dollar value of two assets in a fully arbitraged AMM is always equal. An AMM always sells the outperforming assets and buys the underperforming assets, which is the source of IL since an initial pool contribution is equal in value. The pool keeps selling the outperforming asset during a rally, instead of HODLing, and can no longer profit from subsequent price increases.

If the pool contains 10 ETH (x) and $10,000 (y), then the constant is 100,000 (which is k, equal to the product of x and y in the constant product formula). The AMM offers any trade that maintains the pool constant of 100,000. Let’s say an LP supplies 1 ETH and $1000 to this pool, making up 10% of the pool. With an initial price of $1,000 for ETH, the dollar value of the LP’s contribution is equal to $2,000.

If the price increases to $4,000, arbitrage traders will add USD to the pool and remove ETH while this is happening until the ratio reflects the current price, such that there’s now 5 ETH and $20,000 in the pool. Assume that total liquidity in the pool remains constant, and the dollar value of their position is now $4,000 (0.5 ETH and $2,000), since they have 10% of the pool.

The Impermanent Loss (IL) can be calculated in terms of the initial pool value and HODL value using the following formula (which ignores fees earned for providing liquidity):

IL = (PoolValueUSD/HodlValueUSD)-1

If we plug in the LP’s pool value of $4,000 and the HODL value of $5,000, then the equation above equals ($4,000/$5,000) -1 = (0.8-1) = -0.2 = -20% = -$1,000.

Despite making a nice return of +$2,000 from LP’ing, the HODL value of the position would be $5,000. The LP would have been better off holding the initial ETH position, since the liquidity position is only worth $4,000 in this scenario, so there’s an IL of -$1,000. If the LP removes their liquidity, then this impermanent loss becomes permanent. However, if the ETH price falls back to $1,000, then the impermanent loss goes to zero. This example above abstracts from the trading fees earned, and as long as the collected fees are larger than the impermanent loss, LPs can be profitable.

Another widely used formula to calculate impermanent loss is shown below, where k is the change in price ratio between the two assets in a pool (read this article to learn more about how this formula is derived):

The formula above can be charted to show how price changes in a pool can affect the value of a particular liquidity position. As the price moves higher, the liquidity value will fall as you will be swapping ETH for USD on the way up. However, when the ETH price is on the way down, you’ll be weighted more on this asset.

A 4x price change in either direction results in a 20.0% loss relative to HODL (just like our example above). So the more that the price diverges, the greater IL you face.

Source: Pintail via Medium

You can use DeFi Daily’s impermanent loss calculator to look at different scenarios to see how the maximum IL you may face for given price movements (note that fees earned are not included in the results). You can set the initial and future price of one of the tokens to $1 to estimate the impermanent loss from LP’ing on Perp v2 (since you can only provide liquidity for crypto to USD markets).

What precautions can you take to minimize IL and ensure that the collected fees will outweigh it?

How to Minimize Impermanent Loss?

There are several factors that impact how much IL you may face:

  • Volatility of the assets supplied to a pool: we can think of LP’ing as going short on volatility. Therefore, the more volatile the assets in the pool are, the more likely it is you’ll be exposed to IL. For lower risk, invest in low volatility pairs and start with a small amount to see what kind of returns you can get. However, the trade-off here is that the amount of collected fees is proportional to the volatility of the assets, which means lower returns for LP’ing.
  • Price range: On Uniswap v3, you can choose your price range. The tighter the price range you set on Uniswap v3, the more IL you’re likely to experience. The trade-off is that a wider price range will collect a lower amount in fees since the position is spread out amongst more ticks. The upside, however, is that the impermanent loss you face is lessened.

Understanding impermanent loss is a must for anyone interested in using automated market makers because it can help you to decide when to open or close positions. Some level of impermanent loss is guaranteed with providing liquidity when participating in AMM-based protocols no matter what the price does.

Therefore, it’s important to consider the fee income you can earn and if there are any other incentives (such as liquidity mining rewards) before becoming a LP. Some investors are not worried about impermanent loss, since it is a comparison to a hypothetical situation. Also, depending on your strategy, the fee income may make up for this loss.

--

--

Trustless crypto trading for everyone! Explore perpetual swaps, earn yield and build the future of DeFi with our decentralized trading protocol on Optimism.