What is impermanent loss? How to avoid it?
- Mark Lee
- May 16, 2023
- 5 min read
Updated: May 30, 2023

1. What is impermanent loss in yield farming (YF)?
When the price of a token goes up or down after you deposit it into the liquidity pool, this is called impermanent loss (IL) of the cryptocurrency liquidity pool.
In revenue farming, you are rewarded by lending your tokens, which is directly related to impermanent loss. However, this is different from pledging because investors need to inject money into the blockchain to validate transactions and blocks in order to earn pledged rewards.
In contrast, revenue farming requires lending your tokens to a liquidity pool or providing liquidity. Depending on the protocol, the rewards vary. While revenue farming is more profitable than holding coins, providing liquidity comes with its own risks, including liquidation, control, and price risk.
The number of liquidity providers and tokens in the liquidity pool defines the level of risk of infrequent losses. The token is coupled to another token, usually a stablecoin such as Tether (USDT) and an ethereum-based token such as Ether (ETH). Within a narrow price range, a pool of assets with assets such as stablecoins will be less susceptible to temporary losses. Thus, in this case, the liquidity provider is exposed to a lower risk of impermanent loss of stablecoins.
So, why do liquidity providers on automated market makers (AMMs) continue to provide liquidity when they are vulnerable to future losses? Because transaction fees can compensate for temporary losses. For example, pools on Uniswap are vulnerable to temporary losses, but liquidity providers can be profitable due to the transaction fees charged (0.3%).
2. What is Impermanent Loss Protection?
Impermanent Loss Protection (ILP) is a type of insurance that protects liquidity providers against unexpected losses.
A typical AMM provides profitable liquidity only if the farming proceeds exceed the cost of temporary losses. However, if a liquidity provider suffers a loss, they can use the ILP to protect themselves against impermanent losses.
To activate an ILP, tokens must be pledged to a farm. Let's use the Bancor Network as an example to understand how the ILP works. When a user makes a new deposit, the pledge is activated and the insurance coverage provided by Bancor will grow at a rate of 1% per day, eventually reaching full coverage after 100 days.
Any temporary losses incurred during the first 100 days or at any time thereafter are reimbursed upon revocation of this agreement. However, withdrawals before the 100-day expiration date are only partially compensated for impermanent losses. For example, after 40 days in the pool, the withdrawer will be reimbursed 40% of the temporary loss.
No impermanent loss compensation is given for withdrawals of pledges within the first 30 days; liquidity providers (LPs) are susceptible to the same impermanent losses (ILs) as traditional AMMs.
3. How does anomaly loss occur?
The difference between the value of the liquidity provider's tokens and the theoretical value of the underlying tokens (if they are not paired) results in an impermanent loss.
Let's look at a hypothetical situation to see how the impermanent/temporary loss occurs. Suppose a liquidity provider with 10 ETH wants to provide liquidity for a 50/50 ETH/USDT pool. In this scenario, they need to deposit 10 ETH and 10,000 USDT (assuming 1ETH = 1,000 USDT).
If they participate in a pool with a total asset value of 100,000 USDT (50 ETH and 50,000 USDT), their share will be equal to 20%. The formula is as follows: (20,000 USDT/ 100,000 USDT)*100 = 20%
Calculation of liquidity providers share in the liquidity pool
The percentage of liquidity providers' participation in the pool is also significant because when liquidity providers submit or deposit their assets into the pool via a smart contract, they will immediately receive tokens from the liquidity pool. The liquidity provider can use these tokens at any time to withdraw their portion of the pool (in this case, 20%). So, do you lose money due to impermanent losses?
This is where the concept of impermanent loss is introduced. Liquidity providers are vulnerable to another layer of risk (impermanent loss) because they are entitled to a portion of the pool rather than a certain number of tokens. Thus, this happens when the value of the asset you deposited changes from the value when you first deposited it.
Remember, the greater the change, the greater the risk of impermanent loss to the liquidity provider. The loss here is when the cash value of the withdrawal is less than the cash value of the deposit.
This loss is temporary because if the cryptocurrency can be restored to its original price (i.e. the same price it was at the time of deposit on the AMM), no loss will occur. In addition, the liquidity provider charges a 100% transaction fee to offset the exposure from the inconstant loss.
How is the Impermanent Loss calculated?
In the example discussed above, the price of 1 ETH is 1000 USDT at the time of deposit, but let's assume that the price doubles and 1 ETH starts trading at 2000 USDT. Thanks to the algorithm adjustment pool, it uses a formula to manage the asset.
The most basic and widely used one is the constant product formula, popularized by Uniswap. Simply put, this formula says: ETH liquidity * token liquidity = constant product
Constant product formula
Using the data in our example, based on 50 ETH and 50,000 USDT, we get.
50 * 50,000 = 2,500,000.
Similarly, the price of ETH in the pool can be obtained by the following formula.
Token Liquidity / ETH Liquidity = ETH Price.
i.e. 50,000 / 50 = 1,000.
Now 1 ETH = 2000 USDT at the new price. Therefore:
Formula for ETH liquidity and Token liquidity
This can be verified using the same constant product formula.
ETH liquidity * Token liquidity = 35.355 * 70,710.6 = 2,500,000 (same value as before). So, now we have the following values.
If at this point the liquidity provider wishes to withdraw their assets from the pool, they will exchange their liquidity provider tokens for the 20% share they own. Then, withdrawing their share from the updated amount of each asset in the pool, they will receive 7 ETH (i.e. 20% of 35 ETH) and 14,142 USDT (i.e. 20% of 70710 USDT).
The total amount of assets withdrawn is now equal to: (7 ETH * 2,000 USDT) 14,142 USDT = 28,142 USDT. If these assets were not originally deposited in the liquidity pool, the owner would have received 30,000 USDT [(10 ETH * 2,000 USDT) 10,000 USD].
This difference is caused by the way AMM manages the asset ratios, and this difference is referred to as an impermanent loss. In our Impermanent Loss example, the Impermanent Loss is
Impermanent loss when the liquidity provider withdraws their share of 20%
4.How can I avoid impermanent losses?
Liquidity providers cannot completely avoid anomalous losses. However, there are measures they can use to reduce this risk, such as using stablecoin pairs and avoiding volatile pairs.
One strategy to avoid erratic losses is to choose the best stablecoin pairs against erratic losses because they do not change much in value; because of the reduced risk, they also have fewer arbitrage opportunities. On the other hand, liquidity providers using stablecoin pairs cannot profit from a bullish cryptocurrency market.
Choose cryptocurrency pairs that do not expose liquidity to market instability and erratic losses over cryptocurrencies with a history of instability or high volatility. Another strategy to avoid temporary losses is to thoroughly research this highly volatile market.
In an unstable cryptocurrency market, the value of the assets deposited is expected to fluctuate. On the other hand, liquidity providers must know when to sell assets held in their hands before the price deviates too far from the starting rate.
As a result, major financial institutions do not participate in liquidity pools due to the risk of unpredictable losses from DeFi. However, this problem can be solved if AMM can be widely adopted by individuals and corporations worldwide.
Comments