Impermanent loss is a concept that can become important for investors in DeFi (decentralized finance). It's a phenomenon that occurs when you provide assets to a liquidity pool and the value of those assets fluctuates unfavorably compared to their initial price. Understanding impermanent loss is essential for anyone who wants to maximize returns while minimizing risk in the DeFi ecosystem. But how exactly does it work? Let's find out together.
Table of contents
The basics of liquidity pools in DeFi
Liquidity pools are reserves of assets deposited by investors, which make cryptocurrency pairs available to enable trading on decentralized platforms ( DEXs ).
Unlike the centralized order books of traditional platforms (such as those used by CEXs ), which work by grouping users' buy and sell offers to find matches, DEXs use liquidity pools to facilitate trading without needing this order matching infrastructure.
Centralized order books connect buyers and sellers by displaying bid and ask prices, but this can lead to delays if no matching order is found on low-liquidity assets.
In DEXs, users can trade their tokens directly with the pool, without waiting for a counterparty, as liquidity is always available. In exchange for their contribution to these pools, liquidity providers receive a share of the transaction fees generated by the trades carried out within the pool. However, participating in a liquidity pool carries a risk known as impermanent loss .
Impermanent loss in action: How does it work?
Impermanent loss occurs when the prices of two assets in a liquidity pool change unequally. The key to this phenomenon lies in the automatic rebalancing of the assets in the pool, based on the market maker (AMM) .
When the price of one asset rises or falls relative to the other, the pool adjusts the quantities of both assets to maintain a constant ratio (often 50/50) based on their new values. This means you end up with more of the asset that has risen the least and less of the one that has risen the most, compared to what you would have had if you had kept your assets in a single portfolio .
For example, if the price of token A increases significantly relative to token B, the pool will rebalance by selling some token A to buy more token B to maintain that balance. Impermanent loss then occurs because the value of the assets you receive may be less than what you would have had if you had simply kept them in a wallet.
You can invest in cryptocurrencies with Gemini.
The platform offers:
- Top-notch security, with “cold” storage of the majority of funds
- A dual interface: a simplified application for beginners and ActiveTrader , an advanced platform offering decreasing fees according to volume and a competitive order book.
- Access to more than 60 cryptocurrencies, as well as a rare offering on the market: tokenized stocks (Nvidia, Apple, etc.). These products replicate the price of real stocks via tokens issued directly on the Gemini platform, allowing them to be purchased and traded 24/7 like cryptocurrencies, without going through a traditional stock broker.
- Strict regulatory compliance, with Gemini being one of the first platforms approved in the United States and holding the European license ( MiCA ).
- Additional services such as staking to generate returns on these cryptocurrencies.
Gemini therefore allows you to invest in both cryptocurrencies and tokenized stocks, all in a secure and regulated environment.
Although this loss is often temporary, it can have a significant impact on returns if assets continue to fluctuate unevenly.
Automatic calculation of impermanent loss
Impermanent loss can be calculated automatically using several online tools such as Artisandefi .
Why is it called impermanent?
Impermanent loss is so called because it is not necessarily permanent. If asset prices return to their initial value, the loss disappears. However, if you withdraw your assets while price fluctuations are unfavorable, the loss becomes permanent.
Detailed example of an Impermanent Loss calculation
Let's take the example of a liquidity deposit on Raydium of a SOL/RAY pair with a yield of 45% per annum, or 3.75% per month. We assume that SOL increases by 30% and RAY by 60% in one month.
SOL/RAY Pool :
- Initial amount : €1000 from SOL and €1000 from RAY (total of €2000).
- Initial price of the SOL : 100 €.
- RAY's initial price : 2 €.
- Annual return of the pool : 45% (approximately 3.75% per month)
- We have filed 10 GROUND And 500 RAY in the pool, which gives a constant product:
10 SOL×500 RAY=5000.Here, the constant k = 5000 must remain unchanged.
After 1 month:
- The price of SOL increases by 30% , so 1 SOL now costs €130.
- The price of RAY increases by 60% , so 1 RAY now costs €3.20.
The AMM must now adjust the quantities of SOL and RAY to keep the product x * y = k = 5000 constant, while taking into account the new prices.
Calculation of the new quantities after rebalancing:
New price report :
- The price of the SOL is now €130.
- The price of the RAY is now €3.20.
- The price ratio is: 130/3.20≈40.625.
This means that the ratio between the new quantities of SOL and RAY in the pool must reflect this ratio.
Rebalancing of quantities :
To maintain the balance x * y = 5000 , while respecting the price ratio, the new quantities of SOL and RAY in the pool will be adjusted.
The new quantities of SOL( x' ) and RAY( y' ) must comply with:
- x′∗y′=5000
- The ratio between SOL and RAY must be 40.625 , i.e., y ′/x′=40.625, so we have 2 equations and 2 unknowns: we can solve the system.
- x′∗y′=5000
Quantities adjusted after rebalancing:
New quantity of SOL (x') :
Let's calculate the new quantity of SOL:
After the rebalancing, we therefore have approximately 11.09 SOL in the pool.
New quantity of RAY (y') :
Now, using the price ratio between SOL and RAY to maintain balance, the new quantity of RAY will be: y′=k/x′=5000/11.09≈451.15 RAY.After rebalancing, we have approximately 451.15 RAY in the pool.
Asset value after rebalancing:
Soil Value :
- The new quantity of SOL in the pool is 11.09 SOL , with a price of €130 per SOL.
- The value of the SOL after rebalancing will therefore be:
11,09×130=1441,70€
RAY value :
- The new quantity of RAY in the pool is 451.15 RAY , with a price of €3.20 per RAY.
- The value of RAY after rebalancing will therefore be:
451,15×3,20=1443,68 €
Total value after rebalancing:
- Total value in the pool after rebalancing:
€1441.70 (SOL) + €1443.68 (RAY) = €2885.38
holding strategy (keeping the assets):
If we had simply kept our cryptocurrencies in a wallet, their value would be:
- Value of the SOL : 10 SOL * €130 = €1300 .
- Value of RAY : 500 RAY * €3.20 = €1600 .
Total when holding: 2900 €.
Calculation of the impermanent loss:
Impermanent loss is the difference between the value we would have obtained by keeping the assets in our portfolio and the value we would obtain by depositing them in the liquidity pool.
- Value without impermanent loss (hodl) : 2900 €.
- Value in the pool after rebalancing : 2885,38 €.
The difference is: 2900−2885,38=14,62€.
As a percentage, this represents approximately 0.5% impermanent loss.
Liquidity pool yield:
Let's not forget the return on the pool , which is 3.75% per month.
- Monthly return = 3.75% of €2885.38 = €108.20 .
Total value after rebalancing and yield:
After adding the return, the total value of our investment in the pool will be: 2885,38+108,20=2993,58€.
Conclusion :
- Liquidity pool : After rebalancing and adding the yield, we have €2993.58 .
- Hodling : by simply keeping our cryptos, we have €2900 .
In this case, the liquidity pool proves more advantageous than the holding strategy, because the return of the pool compensates for the impermanent loss which is low (approximately 0.5%).
How to compensate for impermanent loss?
The fees generated by the liquidity pool can help offset impermanent losses. In the previous example, the monthly return of 3.75% generates €101.68 , which compensates for impermanent losses.
Alternatives to liquidity pools to avoid impermanent loss
For those who wish to avoid impermanent loss altogether, there are alternatives such as staking or yield farming . These strategies allow you to generate returns without exposing your assets to price fluctuations within a pool.
The best DeFi platforms for liquidity providing
Uniswap , SushiSwap , Raydium , Aerodrome Finance or Drift via its Backstop AMM liquidity (BAL) are AMMs offering potentially attractive returns for liquidity deposits.
The impact of transaction fees on impermanent loss
Transaction fees generated by pools can play a significant role in offsetting impermanent loss. The higher the trading volume, the higher the fees you, as a liquidity provider, can receive. These transaction fees are reflected in the returns offered by the platform for a given liquidity pair.
Conclusion: Impermanent loss, an inevitable but manageable risk?
Impermanent loss is an unavoidable risk in DeFi, but it is possible to estimate it in order to determine if the return allowed by the Automated Market Maker sufficiently compensates for these losses.
FAQ about impermanent loss
1. What is impermanent loss in DeFi?
Impermanent loss is the loss of value that your assets in a liquidity pool suffer due to the rebalancing of assets carried out by the AMM during the fluctuation of asset prices.
2. Is impermanent loss permanent?
It becomes permanent if you withdraw your assets before prices return to their initial value.
3. How to calculate impermanent loss?
To calculate impermanent loss, you can follow the example given here and replace the values with your own. However, it is more efficient to use online tools that allow you to calculate impermanent loss automatically, such as Artisandefi.
Investments in cryptocurrencies are risky. Crypternon could not be held responsible, directly or indirectly, for any damage or loss caused following the use of a property or service put forward in this article. Investments linked to cryptocurrencies are risky by nature, readers must do their own research before undertaking any action and investing only within the limits of their financial capacities. This article does not constitute an investment advice.
Certain links of this article are affiliated, which means that if you buy a product or register via these links, we will collect a commission from our partner. These commissions do not train any additional cost for you as a user and some even allow promotions.
AMF recommendations. There is no guaranteed high yield, a product with high performance potential implies a high risk. This risk taking must be in line with your project, your investment horizon and your ability to lose part of this savings. Do not invest if you are not ready to lose all or part of your capital .
To go further, read our pages legal notices , privacy policy and general conditions of use .