Impermanent loss and the potential risks and benefits of being a liquidity provider (LP)

Key takeaways:

  • Impermanent loss describes the loss of funds experienced by LPs when the assets price changes compared to when LPs deposited them.
  • Impermanent loss has a positive correlation to the price changes of the assets, meaning the bigger the price change, the more the impermanent loss.
  • LPs earn trading fees and at the same time are exposed to potential impermanent loss.

Introduction

Decentralized exchanges (DEXs) like Uniswap and SushiSwap are built on a beautifully simple concept where the liquidity for exchanges is provided in the format of on-chain pools. The pools can be funded by anyone owning funds with minimum to no entrance barrier, effectively democratizing market-making and enabling frictionless economic activities in the crypto space. Those who funded the pools are called liquidity providers or LPs.

An LP owns a portion of the liquidity pool, and the ownership is represented by LP tokens. With the tokens, LPs can withdraw their portion of the liquidity anytime, and collect all or part of the trading fees. For example, traders pay a 0.3% fee whenever they place a trade on Uniswap. Those fee goes directly to the pool and is splitted among the liquidity providers based on their portion of ownership of the pool.

So, LPs collect trading fees and can withdraw their portion of the pool anytime, does that mean LPs always make money like collecting rents or earning risk-free interests? The answer is no. LPs are imposed to potential impermanent loss risk.

What is impermanent loss and how does it happen?

Impermanent loss describes the loss of funds experienced by LPs when the assets price changes compared to when LPs deposited them. The bigger the change is, the more impermanent loss the LPs are exposed to. It is called impermanent because the loss will only become realized when LPs withdraw their asset from the pool. Only at that point, the loss will become permanent.

So how does impermanent loss happen? Let’s walk through one example of how the price changes cause the impermanent loss for a liquidity provider.

Alice deposited 1 ETH and 1,000 USDC, a total asset value of 2,000 USDC, into the ETH/USDC pool on Uniswap v2 which deploys the constant product AMM X * Y = K, and owned 10% of the pool. That means the pool had 10 ETH and 10,000 USDC total liquidity after Alice deposits.

ETH price increased to $4,000, and the pool caught up with that price thanks to the arbitrage traders. Assuming no new liquidity was added, nor existing liquidity was withdrawn during the price changes, the pool now has 5 ETH and 20,000 USDC (constant K).

If Alice were to withdraw liquidity, she would get 10% of the pool, which equals 0.5 ETH and 2,000 USDC.

The total value of the asset is 0.5 x 4,000 + 2,000 = 4,000 USDC

Remember Alice provided a total asset value of 2,000 USDC to the pool. So, it looks like Alice made a 2,000 USDC profit. However, if Alice hadn’t provided liquidity but instead HODLed her asset (1 ETH, 1,000USDC), her asset would be worth 1 x 4,000 + 1,000 = 5,000 USDC.

Graph illustration of Alice's impermanent loss

We can see that Alice would have been better off by HODLing her asset. By providing liquidity, Alice made 1,000 USDC less profit. That is what’s called impermanent loss.

Understanding impermanent loss

For constant product AMM DEX, the impermanent loss of LP can be interpreted from two views – 1) financial view 2) mathematical view. While the financial interpretation helps us to understand impermanent loss intuitively, the size (amount) of impermanent loss can be calculated with mathematical formulas.

Financial interpretation of impermanent loss

AMM in DeFi gets rid of the middleman and the extra counter-party in centralized finance and acts as the counter-party itself. (Click here to understand how AMM works: What is AMM) If we consider all LPs as a whole – one big LP, then this LP is taking the opposite position of market imbalance. When the price of an asset changes, the market imbalance is guaranteed to be on the market side. For example, if ETH price increases, the market imbalance is that more people will buy ETH. That means the LP has to sell ETH. Selling ETH when price increases shrinks the profits LP can make and causes impermanent loss to happen. Similarly, when the price of an asset decreases, the LP buys that asset involuntarily, and enlarges the loss LP suffers, also leading to impermanent loss.

Mathematical interpretation of impermanent loss

Constant product AMM works on a simple formula of X * Y = K, where the price of asset A priceA = Y/X.

Combining the two equations, we can work out the size of each asset at any given price as:

A_sizepriceA = sqrt(K/priceA)

B_sizepriceA = sqrt(K*priceA)

When the price of asset A changes to priceA’, the asset sizes change accordingly to the above formulas.

Therefore, we have the impermanent loss as:

Impermanent loss = (HODL value – pool value)/(HODL value) = (A_sizepriceA * priceA’ + B-sizepriceA– 2A_sizepriceA’* priceA’)/(A_sizepriceA * priceA’ + B_sizepriceA

Combining the above formulas, we can get:

Impermanent loss = 2(price_ratio)1/2/(1+price_ratio) -1

Where price_ratio = priceA’/priceA

The above formula can be plotted out as the following graph, which gives a better visual interpretation of the impermanent loss size.

Put it numerically, we have:

  • 1.25x price change results in a 0.6% loss
  • 1.50x price change results in a 2.0% loss
  • 1.75x price change results in a 3.8% loss
  • 2x price change results in a 5.7% loss
  • 3x price change results in a 13.4% loss
  • 4x price change results in a 20.0% loss
  • 5x price change results in a 25.5% loss

The loss is the same whichever direction the price moves, i.e. doubling the price causes the same impermanent loss as halving.

Returns for LPs

So, LPs get paid trading fees but are exposed to potential impermanent loss. Can LPs make money? Possibly. The amount of trading fee that LPs receive is determined by the trading volume happening in a pool. The more trading volume, the larger the trading fee. If there is a lot of trading volume in a pool, LPs can still be profitable even if the pool is heavily exposed to impermanent loss. The actual return for the liquidity provider is a balance between impermanent loss and the accumulated trading fees.

Let’s look at two examples.

Below is the 3 months ROI of the ETH/DAI pool on Uniswap.

3 month ROI of the ETH/DAI pool on Uniswap. Source: https://zumzoom.github.io/analytics/uniswap/roi/

This chart shows that for most of the time during the 3 months this account had been in negative balance compared to HODLing the asset. This was due to large impermanent losses caused by ETH price swings. The trading fee had been steadily accumulating, and as the trading volume increased, the trading fees accumulated at a faster speed.

As a comparison, another chart of the 3 months ROI for ETH/WETH pool is shown below.

3 month ROI of the ETH/DAI pool on Uniswap. Source: https://zumzoom.github.io/analytics/uniswap/roi/

This chart shows that the account remained positive returns compared to HODLing the assets. Impermanent loss for this pool was neglectable since the price of ETH/WETH was supposed to be at 1 all the time. Compared to the chart above, the trading fee accumulated for this pool was much smaller (10% compared to 0.3% for 3 months). This is because the trading volume of the ETH/WETH pool was much less significant compared to that of the ETH/DAI pool.

Other than trading fees, many protocols reward their LPs with extras, such as interests or governance token, etc. Associated with the rewards might come with extra risks that LPs are exposed to. These are advanced topics that can be found in other parts of the Academy.

Closing

In closing, the impermanent loss is inherent to the constant product AMM model. Some protocols try to reduce impermanent loss, but it is hard to avoid it completely. LPs earn trading fees and at the same time are exposed to potential impermanent loss. Funding to a DEX is an interesting way to discover the world of DeFi, and to understand how it democratizes market making. However, users should always understand the risks and tradeoffs AMMs come with before depositing.

Discover SynFutures' Crypto Derivatives products: www.synfutures.com/.

Disclaimer: SynFutures Academy does not guarantee the reliability of the site content and shall not be held liable for any errors, omissions, or inaccuracies. The opinions and views expressed in any SynFutures Academy article are solely those of the author(s) and do not reflect the opinions of SynFutures. The SynFutures Academy articles are for educational purposes or information only. SynFutures Academy has no relationship to the projects mentioned in the articles, and there is no endorsement for these projects. The information provided on the site does not constitute an endorsement of any of the products and services discussed or investment, financial, or trading advice. A qualified professional should be consulted prior to making financial decisions.