6 min read · Jun 27, 2024
Impermanent loss refers to a temporary unrealized loss of capital value that arises when providing liquidity to AMM protocols. In its simplest form, impermanent loss is the difference in value between holding your assets versus utilizing the assets to market make and earn yield. Impermanent loss occurs due to the fact that liquidity pool token ratios are constantly changing according to trades against it.
In AMM DEXs, Liquidity Providers (LP) contribute funds to a liquidity pool, which then allows users to buy and sell a particular asset on a decentralized exchange (DEX). The liquidity provider earns a share of the trading fees generated by the DEX in return for their market making liquidity contribution. However, the value of the assets in the liquidity pool can and will fluctuate over time due to buying/selling activity against the pool which changes the pool’s original liquidity balance.
As a result, the total value of the liquidity provided by the LP could decrease relative to the potential value had the LP held their assets and chosen not to participate in the liquidity pool in the first place. This temporary reduction of capital value is known as Impermanent Loss.
It is important to note that impermanent loss is not a guaranteed outcome and can be mitigated through proper risk management strategies, such as diversifying the assets in the liquidity pool or rebalancing the pool regularly. Additionally, some DeFi protocols offer mechanisms to compensate liquidity providers for impermanent loss, such as Yield Farming rewards.
DEFI/DEX Aggregators: An Introduction to Liquidity Optimisation
Automated Market Makers: Explained In 5 Minutes
For ease of understanding, the example below builds upon the example in the AMM explainer. It is highly recommended that you read through the AMM example section first to understand how liquidity pools handles trades as well as liquidity additions/removals. Having knowledge of the above will make understanding impermanent loss much easier.
1. Existing ETH/USDT Pool
There is an initial ETH/USDT pool with a 50:50 ratio of the following token amounts:
- ETH: 100
- USDT: 200,000
Based on the constant product formula detailed in the AMM example, the constant for the pool is now 20,000,000 (i.e. Pool ETH Tokens x USDT Tokens).
2. LP Adds Liquidity
An LP decides to add 5 ETH and the corresponding amount of 10,000 USDT (i.e. 1 ETH = 2,000 USDT) to the pool. Notice that the pool’s token balances increase with the pool constant also increasing by the corresponding amount. Critically, the ETH:USDT ratio in the pool remains the same.
With this addition, the LP owns 4.76% of the pool’s liquidity (5/105 or 10,000/210000). This is represented by a LP Token which is returned to the liquidity provider.
3. Trader Purchases ETH
Following the LP’s liquidity contribution, a trader buys 5 ETH from the pool. Using our constant product formula, the trader sends 10,500 USDT to the pool in exchange for 5 ETH. The ETH is withdrawn from the pool and transferred to the Trader while the Trader’s USDT is added to the pool.
Notice that the ETH;USDT ratio of the pool changes with 1ETH now being worth more USDT after the trade. The LP’s proportion of pool liquidity still remains the same at 4.76%. Critically, the pool’s constant remains unchanged throughout the trade.
4. LP Withdraws Liquidity
After the trade, the LP then decides to withdraw their liquidity from the pool. As the pool ratio has changed due to the trade, we can then compare the total value of the LP’s position (4.76% of pool per step 2) before and after the trade.
To see the impermanent loss, we will have to compare the value after the trade to the value of the position if the LP had just held on to the initial 5 ETH and 10,000 USDT. Notice that if the LP had just held onto both tokens, the total value of his tokens would be 25 USD more (21,025.00–21,000) than if his tokens were provided to the liquidity pool. This 25 USD shortfall is what is known as impermanent loss.
As per deposits into the pool, the pool’s constant value is also decremented by the corresponding withdrawal amount.
If every trade results in impermanent loss for the LP, why would LPs be incentivized to take on the impermanent loss risks given the nominal fees? The answer to this lies in the fact that liquidity pools do not exist in isolation as there are many external token exchanges, each with their own token pair price. If the pool price rises above the market price, arbitrage opportunities will result in the rebalancing of the pool and vice versa. Through this rebalancing, LPs earn fees from both the initial trade as well as the arbitrage trade.
In effect, arbitrageurs are a critical component of the AMM design ensuring that the pool always rebalances itself. It is this period between pool rebalancing which results in such losses being termed “impermanent”. If the pool returns back to the initial ratio, LPs will be able to withdraw the same amount of tokens added with the additional fees accrued from providing liquidity.
Nevertheless, this impermanent loss risk can become permanent if token pair valuations diverge significantly from each other and never reapproaches the initial ratio when liquidity was added. This is more likely to happen for less correlated token pairs and hence higher trading fees are required in order to offset the impermanent loss risks. This is the reason why pool trading fees tends to be in line with token correlation.
While impermanent loss (IL) can be very intimidating for LPs, it is critical to frame it in the context of market making. In this light, IL effectively compares a theoretical best case scenario against actual market performance.
Trades against an AMM are automated hence by consenting to provide liquidity, you are always taking the flip side of a swap initiated by a trader. That is, the trader only chooses to execute the trade if they think that they are exchanging a lower valued token for a higher valued token. In short, any trades against your liquidity will always result in IL.
IL is therefore a natural outcome of the market making process whereby yield can only be generated by taking on the market risk that prices permanently deviates from the initial price. Put simply, the trading fee is a premium that is charged to traders for taking on price volatility risks.
As a LP, the most important question is whether the fees and rewards generated will be sufficient to cover the expected IL for your selected duration. This means having a reasonable conviction that prices will rebound and having the patience to wait until the right time to realize any market making profits.