How Does Impermanent Loss Occur?
Impermanent loss is a phenomenon that occurs when providing liquidity to a decentralized exchange (DEX) as part of liquidity mining. This risk is primarily associated with Automated Market Makers (AMMs), where liquidity providers deposit pairs of tokens into a liquidity pool to facilitate trading.
When the price of the tokens in the liquidity pool fluctuates, the relative value of the tokens changes. For instance, if you deposit equal values of Token A and Token B and the price of Token A increases significantly, arbitrageurs will buy Token A from the pool, leading to a decrease in the pool's Token A balance.
As a result, liquidity providers end up holding a smaller amount of the appreciating token and a greater amount of the depreciating one. If the liquidity provider withdraws their funds while this price discrepancy exists, they experience a loss compared to just holding the tokens outside the pool. This loss is termed 'impermanent' because if the prices return to their original state, the loss may be mitigated or disappear.
To sum up, impermanent loss occurs due to price fluctuations of the assets in a liquidity pool and happens when liquidity providers withdraw their assets at a time when the price has moved unfavorably compared to when they initially deposited.