Impermanent loss refers to the loss that funds can be exposed to when they are in a liquidity pool. This is one of the major challenges facing liquidity providers (LPs) who provide the funds for these pools, and many need to consider whether the rewards provided by these pools (usually token incentives) are worth the risk of impermanent loss.
We cover this topic in depth in our white paper on how to mitigate the risk of impermanent loss .
However, if you’re new to the topic, you might not know what impermanent loss is and how it works. To understand impermanent loss, one must first know about liquidity pools, which are the decentralised version of exchanges.
Liquidity pools exist to ensure that liquidity is available for decentralised swaps. But why do we need liquidity?
Liquidity refers to the ease of buying or selling an asset in the market. It characterises how fast an asset can be converted to another currency. If no transaction occurs due to a lack of buyers or sellers, we face a liquidity crisis, which blocks the entire market.
For this reason, it is necessary to have enough liquidity for a specific pair of tokens to exist, because buyers want to be sure they will be able to sell it at a later time.
In the CeFi world, exchanges have what is known as an order book, where buyers and sellers enter their orders.
The first type of orders is limit orders, which are orders for an asset at a fixed price, set by the buyer or seller who places the order. These orders create liquidity, and those who make them are called ‘makers’. Other users trade with market orders, which are not at a set price but rather buy and sell assets at whichever price they are available. These then use all the limit orders necessary for a specific quantity. They are referred to as takers.
Of course, in most exchanges, bots exist to automatically provide additional liquidity to given pairs. They are a necessary component to create healthy liquidity and avoid liquidity crises.
In the decentralised world, it is more complicated to build a standard order book, mainly due to gas fees and the speed of transactions. Every order would need to be recorded on the blockchain and would need to be available within milliseconds.
For this reason, another way to create liquidity for a pair of tokens was built: the liquidity pool. In such a pool, users called liquidity providers (LPs) deposit pairs of assets, like Ether (ETH) and Bitcoin (BTC).
Other investors are then able to trade ETH vs BTC, by exchanging one asset for the other. In exchange for tying up their assets, LPs are rewarded based on the number of transactions that are made. The larger the pool, the more investors trade on it, thus the more LPs are rewarded.
The most common types of liquidity pools work as follows:
The pool operates on a 50/50 ratio, which means that when an LP deposits assets, they must deposit the same value of each asset at the current market price.
Let’s take a DAI/ETH liquidity pool, for example. If we assume the ETH/DAI price is 2,400, a new LP can deposit 1 ETH and 2,400 DAI, 2 ETH and 4,800 DAI, etc. The ratio must remain constant.
To adjust the pool exchange price and keep it consistent with other markets prices, Uniswap uses a constant automatic market-making formula. The rule is: in the pool, the product of the asset quantities must remain constant.
For example, assume the pool contains 100 ETH and 240,000 DAI. The product of the two tokens is 24,000,000, and this product must remain constant.
K = 100 x 240,000 = 24,000,000
In order to buy 20 ETH, the pool will be reduced to 80 ETH. To maintain the constant product of 24,000,000, you would divide it by 80 to determine the total amount of DAI required - 300,000. Therefore, to remove 20 ETH from the pool you would need to pay 60,000 DAI to maintain the constant product.
After the transaction, the ETH/DAI price in the pool is 300,000/80 = 3,750.
Thanks to arbitrageurs, this price reflects the actual price on the market. For more details, the constant product rule in our article on flash loan attacks.
A larger pool entails more liquidity, which reduces the impact of transactions on assets prices (slippage).
As we saw in the example above, where the ETH/DAI price rose from 2,400 to 3,750, traders must be careful when trading on DEXs to avoid too much slippage. LPs must also be mindful when providing liquidity, as they may face impermanent loss.
Impermanent loss represents the loss compared to a simple holding strategy of the two assets (outside the pool). As we saw, when a price change occurs (or a trade) the balance inside the pool will change to reflect the new price. It will result in a loss compared to the holding strategy. This loss is called impermanent, as it can be removed if the price comes back to the initial value.
Let’s work out an example with the previous values. We started with a pool composed of 100 ETH and 240,000 DAI. For simplicity, we’ll assume that it is a single LP whose portfolio value is 480,000 DAI. After the trade, we saw that the amount in the pool was changed to 80 ETH and 300,000 DAI. The price of ETH was then 3,750 DAI, which leads to a value of the pool: 600,000 DAI.
If we assume that the LP didn’t put the tokens in the pool, he would still have 100 ETH and 240,000 DAI, for a value of 615,000. The loss compared to holding is 15,000 DAI.
To compensate for the loss and attract liquidity, most of the platforms distribute “incentive” tokens to the LPs (such as CRV, UNI, SUSHI, etc.). This extra reward is added on top of the transaction fees that the LPs receive. For this reason, LPs must carefully analyse if the rewards are worth the risks.
This raises the questions of how LPs can mitigate impermanent loss? Find out in our latest white paper, written in partnership with Kesitys, on the optimisation of impermanent loss .