If you've participated in DeFi projects, you may have heard the term Impermanent Loss. Simply put, the term describes the losses liquidity providers may experience due to price divergence. Impermanent loss happens when the prices of your tokens change compared to when you deposited them in the pool.
It's called impermanent loss because the price divergence between the assets in the pool may eventually reverse. If that happens, the effects of impermanent loss are mitigated. Please note that the reverse is not guaranteed. Impermanent loss is also called divergence loss.
How does impermanent loss happen?
Users provide their assets to a liquidity pool to become liquidity providers (LP). In return, they get a portion of the transaction fees that traders paid to the pool. Liquidity pools are used by the largest segment of automated market makers (AMM), called constant function market makers (or CFMMs).
When the price of deposited assets in a liquidity pool changes compared to the time LPs deposited them, impermanent loss happens. The bigger this change is, the more they are exposed to impermanent loss.
This price divergence can give traders or arbitrageurs profitable opportunities. They can execute the arbitrage trade until it brings the token price back in line with the wider market. This results in impermanence loss for liquidity providers.
Worked example of impermanent loss
Let's use a liquidity pool constructed on a constant product AMM system as an example. This AMM uses a relatively simple formula as a pricing mechanism:
x * y = k.
This formula is used to calculate the prices of the two digital assets in the liquidity pool. In this pricing formula, k is constant. This means that the sum of the two assets contained in the pool (x multiplied by y) should always be the same (k) before and after a trade is executed.
Let's suppose that the two digital assets in the liquidity pool are ETH and DAI, and you deposit 1 ETH and 100 DAI. This type of AMM requires that the two deposited assets maintain a 1:1 ratio, which means that 1 ETH = 100 DAI. Since 1 DAI = 1USD, your deposited assets are now valued at $200.
Now imagine that the total pool contains 10 ETH and 1,000 DAI, which is worth $2,000. This means you have a 10% share of the pool. The constant is k = 10 (ETH) * 1000 (DAI) = 10,000, which must always be equal before and after a transaction in the pool.
Suppose that the ETH price rises to 400 DAI. According to the AMM formula, the price of ETH in the pool is still 100 DAI. At this time, arbitrageurs can buy ETH at a lower price from the liquidity pool until the token price is back in line with the external price.
If we ignore the transaction fees, there will be 5 ETH and 2,000 DAI in the liquidity pool. At the same time, the constant k is still 10,000.
If you decide to withdraw funds during this time, you can now withdraw 0.5 ETH and 200 DAI (10% of the pool), which equals $400 (excluding fees). That doesn't seem so bad, but wait! If you would have HODLed rather than deposited these tokens, you would now have $500 worth of assets. So that's how you can lose $100 compared to just holding your tokens, and this is what we call impermanent loss.
Trading fees in impermanent loss
The previous example disregards the trading fees you would have earned for providing liquidity. In many cases, the fees earned would negate the losses and make providing liquidity profitable nevertheless. Even so, it's crucial to understand impermanent loss before providing liquidity to an AMM protocol.
Please note: impermanent loss happens no matter which direction the price changes. The only thing impermanent loss cares about is the price ratio relative to the time of deposit.
Although becoming a liquidity provider can be profitable, impermanent loss is a key concept you need to understand before depositing funds into a liquidity pool. It's your responsibility to DYOR.
To learn more details, please refer to the Binance Academy article Impermanent Loss Explained
To learn more about Binance Liquid Swap AMM System, please refer to AMM Formula Explained