- The cryptocurrency industry is filled with maximum risk, hence investors must properly conduct research before being fully immersed.
- It is important to note that through decentralised finance (DeFi), crypto investors can generate streams of passive income. This is often through staking, providing liquidity, and yield farming.
- One of the major risks associated with liquidity provision is impermanent loss. And the more the slippage in the prices of assets in a liquidity pool, the more losses an investor incurs.
- The guide fully explores the concept of impermanent loss in its entirety, including how to calculate and overcome it.
What is Impermanent Loss?
Impermanent loss (IL) is a common phenomenon in crypto where the price of a token fluctuates (rises or falls) after an investor deposits it in a liquidity pool. Impermanent loss is directly related to yield farming.
Yield farming is the process of lending tokens to a decentralised protocol’s liquidity pool in order to earn rewards. Yield farming should not be interchanged with staking, where investors are requested to inject money into the blockchain to confirm and validate transaction blocks in order to earn staking rewards. Yield farming entails investors depositing tokens into a liquidity pool.
The rewards from liquidity pools vary with the protocol involved. But since yield farming seems to be more profitable, some investors now find holding coins unattractive.
The risk of impermanent loss is directly tied to the amount of liquidity provided and the total number of tokens in the liquidity pool. In a liquidity pool, tokens are usually paired. It could be a stablecoin such as Tether’s USDT or Ethereum-based tokens such as Ether (ETH). Certain pools with stablecoins that have a narrow price fluctuation are often less vulnerable to temporary losses. This means liquidity providers often face a lower risk of impermanent loss with stablecoins.
While liquidity providers who deal with automated market makers (AMM) are vulnerable to future losses, they tend to provide liquidity to volatile pairs because trading fees can compensate for these losses. For example, Uniswap has a trading fee of 0.3% with liquidity pools that are highly susceptible to volatility and impermanent loss.
It is important to understand that impermanent losses are impermanent because as token prices fluctuate, the prices of the tokens may eventually return to the value at the point of the deposit. Should investors remove their money before this time, their losses will be permanent.
How Do Impermanent Losses Occur?
Impermanent loss occurs when there is a difference between the value of the liquidity provider’s tokens and the underlying tokens that if they weren’t paired in the pool. When a pool’s smart contact is created, the balance of each token will be zero. In order to facilitate trades, the proof must be seeded with an initial deposit of each token, either ETH/USDT or DAI/ETH.
The first liquidity provider sets the initial price of the proof and is incentivised to deposit an equal value of both tokens into the pool. For instance, if a liquidity provider with 10 ETH wants to provide liquidity to a 50/50 ETH/USDT pool, such an investor will need to deposit 10 ETH and 10,000 USDT (this is if the price of ETH is 1,000 USDT).
Assuming the pool has a total value of 100,000 USDT, i.e. 50 ETH and 50,000 USDT, such an investor’s share will be 20% of the pool, using this simple equation:
10ETH (10,000 USDT) + 10,000 USD X 100 = 20%
However, if the liquidity provider deposits tokens that are in a ratio that is different from the market rate, an arbitrage opportunity is immediately created and leveraged by an external party. If they believe the current market price is incorrect, they could arbitrage it and add more liquidity to the pool until the desired level is reached.
The percentage of a liquidity provider’s participation is important because when deposits are made into a pool through smart contracts, they are instantly rewarded with liquidity provider (LP) tokens. Such investors can withdraw their portion of the pool (e.g. 20%) using the LP tokens. Because investors are entitled to a certain portion of the pool and not a definite quantity of tokens, they are susceptible to impermanent loss, which happens when the value of deposited tokens changes compared to the time when they were deposited.
Liquidity providers must understand that the larger the degree of change, the more impermanent loss they will be exposed to. This is because the fiat value of the withdrawal would be further from the value of the deposit. However, such losses can be recovered because prices can return to how they were at the point of deposit on the AMM. Trading fees can cover the risk of exposure and hence act as a reward for the risk.
How to Estimate and Calculate Impermanent Loss
Estimating impermanent loss is just as simple as introductory concepts in blockchain technology. Given the volatile nature of cryptocurrencies, price movements become unpredictable. The same can also be said for impermanent loss, leaving liquidity providers with the ability to only estimate the intensity. This implies that impermanent loss can keep changing until an external measure is taken. As such, if an investor decides to withdraw their funds after slight price changes or not, impermanent loss can become permanent.
In other cases, liquidity providers can get prices that are higher than envisaged, providing an opportunity for arbitrage trading. For instance, if the new price of Ether rises, there will be an opportunity for arbitrage traders to buy the coins at a cheaper rate. Because the new ETH price will be different from the previous price in the liquidity pool, the ETH can be replaced with another token and deposited until the ratio arrives at a new rate. This method of estimation often takes place in standard liquidity pools, enabling investors to assess the approximate value of an impermanent loss concerning a deposit in a cryptocurrency wallet.
Similarly, impermanent loss can be calculated using the constant formula. The formula states that:
ETH liquidity x token liquidity = Constant product.
Following the previous example where 1 ETH was 1000 USDT, let’s assume that it doubled to 2000 USDT. Since a smart contract algorithm adjusts the pool, the above formula can be used to manage the assets.
Using the same example where the pool is 50:50 ETH/USDT, the constant will be 2,500,000, i.e 50 x 50,000 = 2,500,000.
With the same formula, the price of ETH can be determined. i.e.
Token liquidity/ETH liquidity = ETH price
50,000/50 = 1000.
But, since the new price of Ethereum is 2000, the formula for ETH liquidity and token liquidity will be:
ETH liquidity = square root (constant product / ETH price)
Token liquidity =square root (constant product x ETH price)
Therefore, the ETH liquidity and token liquidity at the new price of 2000 will be:
ETH liquidity = Square root (2,500,000/2000) = 35.35 ETH.
Token liquidity = Square root (2,500,000 x 2000) = 70,710.6 USDT
If this was to be verified with the constant product formula, where ETH liquidity x token liquidity = constant;
Then 35.355 x 70,710.6 = 2,500,000.
While the old liquidity is 50 ETH and 50,000 USDT, the new liquidity ratio will be 35 ETH and 70,710 USDT.
At this point, the liquidity provider might choose to withdraw their 20% share of the liquidity pool. Taking their share from the updated amount, the investor will have 7 ETH (i.e 20% of 35 ETH) and 14,142 USDT (i.e 20% of 70,710 USDT). The total value of assets withdrawn will be 7ETH X 2,000 USDT + 14,142 USDT = 28,142 USDT
These differences occur due to the manner AMMs manage the market, and it is called impermanent loss.
How to Avoid Impermanent Loss
Avoiding impermanent loss is quite difficult for liquidity providers due to the rapid changes in the price of crypto assets. However, several strategies exist for managing impermanent loss. These strategies include the introduction of trading fees, maintaining low volatility, eliminating complexities in liquidity pools, and single-sided liquidity pools.
Introduction of trading fees
Trading fees can be described as charges collected from traders who service the liquidity pool. Ideally, when considering impermanent loss, it is important that liquidity providers ensure a portion of the trading fees is included in the liquidity pool. When trading fees are collected from traders, a certain percentage of the total fees can be given to liquidity providers just to enhance the proper management of the protocol. The amount, in some cases, is sufficient to compensate for the impermanent losses.
In DeFi protocols where more trading fees are collected, cases of impermanent loss are reduced.
Maintaining low volatility
Impermanent loss is more common in token pairs with greater volatility. To wade off an impermanent loss, investors can choose liquidity pools with token pairs exhibiting lower volatility. Such digital assets are often stablecoins such as USDT and DAI. Other cryptocurrency pairs with variations of a certain token can help to maintain low volatility.
Investors who practice this strategy must ensure that the cryptocurrency pairs follow nearly the same price movements.
Eliminating complexities in liquidity pools
Complexity in liquidity pools is one of the reasons why impermanent loss occurs. Complexities happen due to an equal split needed by most liquidity pools. And as long as complexities exist, impermanent loss will remain.
To eliminate these complexities, some decentralised exchanges now allow several variations of liquid pool ratios to neutralise the overall effect. One such exchange is Balancer. Unlike other decentralised protocols that create liquidity pools for single pairs such as ETH/USDT or ETH/DAI, Balancer offers the ability for LPs to deposit liquidity into multiple ratio weights, and up to 8 tokens in a pool.
Single-sided liquidity pools
One of the ways through which impermanent loss occurs is when two different extremely volatile crypto assets are deposited in a single-sided liquidity pool. While some decentralised exchanges now offer liquidity pools to take the stake on only one side, the other side of the liquidity pool is still inaccessible to the liquidity provider.
This strategy ensures there are no risks of impermanent loss as the user only provides access to one side of the liquidity pool. Since an oracle provides the decentralised exchange with price feeds, the liquidity pool automatically adjusts when prices fluctuate.
Other strategies that can guard liquidity providers against impermanent losses include:
- Choosing crypto pairs that do not expose liquidity to market instability and temporary loss. This is far better than opting for crypto assets that have high volatility and unstable history.
- Liquidity providers should always research the market for high volatility. This gives an insight into which assets are the riskiest.
How Impermanent Loss Protection Helps Liquidity Providers
Impermanent loss protection can be viewed as an insurance cover. Liquidity provision is profitable on AMMs if the yield of farming exceeds that of temporary loss. In situations where investors incur losses, the impermanent loss protector can be used to protect against impermanent loss.
To activate this protection, an investor must stake some tokens. A perfect example of an exchange where the IL protection works is the Bancor exchange. When an investor makes a new deposit, Bancor Network provides insurance coverage that lasts 100 days at a rate of 1% per day. If a temporary loss occurs within these 100 days, such investment is covered at the time of withdrawal. However, if a withdrawal is made before the expiration of the 100 days maturity, such an investor only gets partial compensation against impermanent loss.
Merlin by VALK identifies liquidity pools on major DEXs and for Uniswap V3, it analyses open and closed positions since the first executed transaction by that wallet. It allows the filtering of information by protocol and transaction (e.g., added liquidity, exchange, deposit, borrow and more). Merlin’s unique analysis calculates total yield and total P&L related to the position, shows
inner transactions, and checks whether the investor is in range or not
Importantly, Merlin calculates the impermanent loss and presents the full picture for both unclaimed and claimed fees. Soon, Merlin will allow investors to claim fees directly from its interface without having to switch platforms
Frequently Asked Questions (FAQs)
What is impermanent loss?
Impermanent loss is a phenomenon that occurs when a user deposits tokens in a liquidity pool and the market value of such token fluctuates considerably while in the pool. The difference in the value at the time of deposit and when the change occurs is called impermanent loss.
Is impermanent loss permanent?
Impermanent losses are usually temporary because as the price fluctuates, the value of the deposited tokens in the pool can return to the initial deposit price. Losses only become permanent should the liquidity provider withdraw the token before the market recovers.
What is a liquidity pool?
A liquidity pool is where lenders can deposit specific pairs of assets as liquidity. This allows DeFi users to swap tokens easily. Such pools are often found in decentralised exchanges.
What are stablecoins?
Stablecoins are cryptocurrencies whose value is pegged to a particular fiat currency, collateralised by fiat assets, other digital assets, or algorithmically. Examples are USDT, USDC, BUSD, cUSD, DAI, etc.
What are decentralised exchanges?
Decentralised exchanges are protocols that facilitate DeFi actions such as swapping, liquidity provision and market making. They are managed by smart contracts on the blockchain and participation occurs via peer-to-peer interactions directly from the user’s wallet, without the influence of an intermediary. Examples include PancakeSwap, Uniswap, Balancer, and dYdX.
What is staking?
Staking is the process where an investor lends tokens to a DeFi protocol/consensus mechanism, where these tokens are locked in a vault for a given period in order to earn rewards.