When it comes to learning and participating in DeFi, it’s important to factor in all the risk versus reward. As the golden rule says, the higher the risk, the greater the reward. Therefore, today, we’ll learn about the concept of impermanent loss.
However, to understand the concept of impermanent loss, it is recommended to first learn the concept and working of decentralized exchanges, especially AMMs (Automated Market Makers). Therefore, I’d suggest following the link below to get a better understanding of AMMs in a simple language.
What are Automated Market Makers?
What is Impermanent Loss?
Impermanent loss can be simply defined as the risk of losing funds while participating in a liquidity pool. But what’s a liquidity pool and why would you participate in this? Let’s find out.
A liquidity pool is a pair of assets available for trading on a decentralized exchange. Thus enabling users to swap those assets by depositing one in exchange for another. For example, a liquidity pool of ETH/USDC will allow users to trade ETH for USDC or vice versa by paying a small transaction fee (usually 0.3%).
Furthermore, users can also participate in such a liquidity pool by depositing both the assets and earning a fixed income through transaction fees paid by the traders. Going with the example mentioned above, a user can deposit ETH and USDC in the ETH-USDC pool and earn rewards through her share of the liquidity pool.
Now, in the case when the ratio of the tokens in the liquidity pool becomes uneven, a user might be exposed to impermanent loss. However, it’s worth noting that the impermanent loss isn’t realized until the user decides to withdraw her pair of tokens from the liquidity pool.
How Impermanent Loss is Calculated?
The impermanent loss is usually calculated by comparing the value of tokens deposited in a liquidity pool against the value of tokens if they’re simply being held in a wallet. Let’s understand it through an example.
Let’s say, a user decides to deposit 0.05 ETH and 500USDC in a liquidity pool with a 50/50 ratio considering the price of 1 ETH to be $10,000. At the time of depositing, the dollar value of her funds is $1000 (0.05 ETH + 500 USDC where 1 ETH = $10,000 and 1 USDC = $1). Let’s say, currently, there is a total of 5 ETH and 50,000 USDC in the pool, giving the user a 1% share of the pool.
Now, if the price of a token fluctuates, the user will be exposed to an impermanent loss. Here’s how it will look like. Let’s say the price of ETH rises to $20,000. In this case, the liquidity pool would have 3.5355 ETH and 70711.35 USDC following the constant product formula. Keep in mind that the user owns a 1% share of the pool, she can withdraw 0.035355 ETH and 707.1 USDC which equals $1414.21 in dollar value.
However, if the user had held these assets in her wallet without participating in the liquidity pool, she would have had $1500 worth of assets (0.05 ETH + 500 USDC where 1 ETH is now equal to 20,000 and USDC being a stablecoin will be worth same as earlier, i.e., $1). Hence her impermanent loss, in this given scenario is 5.71%.
Impermanent Loss = (Value of assets if held in the wallet minus value of assets when withdrawing from the liquidity pool)
Impermanent Loss = $1500 – $1414.21 = $85.79
To make things simple, here’s a complete dashboard for impermanent loss when participating in a pool with a speculative asset and a stablecoin.
- 1.25x price change = 0.6% loss
- 1.50x price change = 2.0% loss
- 1.75x price change = 3.8% loss
- 2x price change = 5.7% loss
- 3x price change = 13.4% loss
- 4x price change = 20.0% loss
- 5x price change = 25.5% loss
It’s worth noting that the above impermanent loss estimation doesn’t account for fees earned for providing liquidity.