What is impermanent loss and how to avoid it?

Published at: April 24, 2022

How to avoid impermanent loss?

Liquidity providers cannot avoid impermanent loss completely. However, they can use some measures to mitigate this risk such as using stablecoin pairs and avoiding volatile pairs.

One strategy to avoid temporary loss is to choose stablecoin pairs that offer the best bet against IL since their value does not move much; they also have fewer arbitrage opportunities, lowering the risks. Liquidity providers using stablecoin pairs, on the other hand, are unable to gain from the bullish crypto market.

Choose pairs that do not expose liquidity to market instability and temporary loss rather than cryptos with an unstable history or high volatility. Another strategy to avoid temporary loss is to search the market, which is highly volatile thoroughly.

As a result, deposited assets are expected to fluctuate in value. Liquidity providers, on the other hand, must know when to sell their holdings before the price drifts too far from the starting rates.

As a result, significant financial institutions do not participate in liquidity pools due to the risk of a temporary loss of DeFi. However, if AMMs are to be widely adopted by individuals and enterprises around the world, this problem can be solved.

How does impermanent loss happen?

The difference between the LP tokens' value and the underlying tokens' theoretical value if they hadn't been paired leads to IL.

Let's look at a hypothetical situation to see how impermanent/temporary loss occurs. Suppose a liquidity provider with 10 ETH wants to offer liquidity to a 50/50 ETH/USDT pool. They'll need to deposit 10 ETH and 10,000 USDT in this scenario (assuming 1ETH = 1,000 USDT).

If the pool they commit to has a total asset value of 100,000 USDT (50 ETH and 50,000 USDT), their share will be equivalent to 20% using this simple equation = (20,000 USDT/ 100,000 USDT)*100 = 20%

The percentage of a liquidity provider's participation in a pool is also substantial because when a liquidity provider commits or deposits their assets to a pool via a smart contract, they will instantly receive the liquidity pool's tokens. Liquidity providers can withdraw their portion of the pool (in this case, 20%) at any time using these tokens. So, can you lose money with an impermanent loss?

This is where the idea of IL enters the picture. Liquidity providers are susceptible to another layer of risk known as IL because they are entitled to a share of the pool rather than a definite quantity of tokens. As a result, it occurs when the value of your deposited assets changes from when you deposited them.

Please keep in mind that the larger the change, the more IL to which the liquidity provider will be exposed. The loss here refers to the fact that the dollar value of the withdrawal is lower than the dollar value of the deposit.

This loss is impermanent because no loss happens if the cryptocurrencies can return to the price (i.e., the same price when they were deposited on the AMM). And also, liquidity providers receive 100% of the trading fees that offset the risk exposure to impermanent loss.

How to calculate the impermanent loss?

In the example discussed above, the price of 1 ETH was 1,000 USDT at the time of deposit, but let's say the price doubles and 1 ETH starts trading at 2,000 USDT. Since an algorithm adjusts the pool, it uses a formula to manage assets.

The most basic and widely used is the constant product formula, which is being popularized by Uniswap. In simple terms, the formula states: 

Using figures from our example, based on 50 ETH and 50,000 USDT, we get:

50 * 50,000 = 2,500,000.

Similarly, the price of ETH in the pool can be obtained using the formula:

Token liquidity / ETH liquidity = ETH price,

i.e., 50,000 / 50 = 1,000.

Now the new price of 1 ETH= 2,000 USDT. Therefore,

This can be verified using the same constant product formula:

ETH liquidity * token liquidity = 35.355 * 70, 710.6 = 2,500,000 (same value as before). So, now we have values as follows:

If, at this time, the liquidity provider wishes to withdraw their assets from the pool, they will exchange their liquidity provider tokens for the 20% share they own. Then, taking their share from the updated amounts of each asset in the pool, they will get 7 ETH (i.e., 20% of 35 ETH) and 14,142 USDT (i.e., 20% of 70,710 USDT).

Now, the total value of assets withdrawn equals: (7 ETH * 2,000 USDT) 14,142 USDT = 28,142 USDT. If these assets could have been non-deposited to a liquidity pool, the owner would have earned 30,000 USDT [(10 ETH * 2,000 USDT) 10,000 USD].

This difference that can occur because of the way AMMs manage asset ratios is called an impermanent loss. In our impermanent loss examples:

What is impermanent loss protection?

Impermanent Loss Protection (ILP) is a type of insurance that protects liquidity providers from unexpected losses.

Liquidity provisioning is only profitable on typical AMMs if the benefits of farming surpass the cost of temporary loss. However, if the liquidity providers suffer losses, they can utilize ILP to protect themselves against impermanent loss.

To activate ILP, tokens must be staked on a farm. Let's use the example of the Bancor Network to understand how ILP works. When a user makes a new deposit, the insurance coverage provided by Bancor grows at a rate of 1% per day the stake is active, eventually reaching full range after 100 days. 

Any temporary loss that happened in the first 100 days or at any time after that is covered at the time of withdrawal by the protocol. However, only partial IL compensation is available for withdrawals made before the 100-day maturity. For instance, after 40 days in the pool, withdrawals receive a 40% compensation for any temporary loss.

For stakes withdrawn within the first 30 days, there is no IL compensation; the LP is liable to the same IL they would have incurred in a conventional AMM.

What is an impermanent loss in yield farming?

When a token price rises or falls after you deposit it in a liquidity pool, this is known as crypto liquidity pools' impermanent loss (IL).

Yield farming, in which you lend your tokens to gain rewards, is directly related to impermanent loss. However, it is not the same as staking, as investors are required to inject money into the blockchain to validate transactions and blocks to earn staking rewards. 

On the contrary, yield farming entails lending your tokens to a liquidity pool or providing liquidity. Depending on the protocol, the rewards vary. While yield farming is more profitable than holding, offering liquidity has its risks, including liquidation, control and price risks. 

The number of liquidity providers and tokens in the liquidity pool defines the risk level of impermanent loss. The token is coupled with another token, usually a stablecoin such as Tether (USDT) and an Ethereum-based token like Ether (ETH). Pools with assets like stablecoins within a narrow price range will be less vulnerable to temporary losses. As a result, liquidity providers face a lower risk of impermanent loss with stablecoin in this scenario.

So, since liquidity providers on automated market makers (AMMs) are vulnerable to future losses, why do they continue to provide liquidity? It is because trading fees might compensate for the temporary loss. For instance, pools on Uniswap, which are highly susceptible to temporary loss, can be profitable due to trading fees (0.3%).

Tags
Related Posts
Altcoin Roundup: Stablecoin pools could be the next frontier for DeFi
In times like these, when the entire cryptocurrency market is down and there is nary a sector-wide runup to be found, traders have to dig into data to see how the market dynamics may have changed to pinpoint signs of new growth. Stablecoins are the newest trend to emerge in the decentralized finance (DeFi) arena due to the resiliency they bring to the sector, especially since protocols that are more reliant on the dollar-pegged assets continue to offer token holders low-risk yield opportunities in turbulent market conditions. Possible evidence of stablecoins rising influence can be found in the difference between …
Markets / June 25, 2021
Unconfirmed: Crypto Startup Enjin to Back Rumored Samsung Galaxy S10 Blockchain Wallet
South Korean crypto company Enjin Wallet has reportedly been appointed by Samsung to back a blockchain wallet in its new Galaxy S10 smartphone, anonymous sources told Asia Crypto Today on Monday, Feb. 25. The anonymous interlocutors provided an image to the outlet that was purportedly posted by Tworld — Korea’s second largest telecom company. The screenshot shows the Enjin wallet being used in the Galaxy S10 for Ethereum (ETH) transactions. The image also features Enjin coin (ENJ) and Basic Attention Token (BAT) — an Ethereum-based token used in digital advertising. Enjin Wallet reportedly used in Samsung blockchain keystore. Source: asiacryptotoday.com …
Blockchain / Feb. 25, 2019
Ethereum white paper predicted DeFi but missed NFTs: Vitalik Buterin
Rounding up the last decade, Ethereum co-founder Vitalik Buterin revisited his predictions made over the years, showcasing a knack for being right about abstract ideas than on-production software development issues. Buterin started the Twitter thread by addressing his article dated Jul. 23, 2013 in which he highlighted Bitcoin's (BTC) key benefits — internationality and censorship resistance. Buterin foresaw Bitcoin’s potential in protecting the citizens’ buying power in countries such as Iran, Argentina, China and Africa. However, Buterin also noticed a rise in stablecoin adoption as he saw Argentinian businesses operating in Tether (USDT). He backed up his decade-old ideas around …
Adoption / Jan. 2, 2022
Indie Russian news firm raises $250K in crypto after sanctions cripple finances
A Russian independent news company has raised more than $250,000 in cryptocurrency donations from supporters in order to continue reporting independent news under a barrage of Russian government propaganda and censorship. Meduza, a Latvian-based Russian-language news site that claims to report on “the real Russia, today,” has been asking for donations since April 2021 in the form of United States dollar, euro and cryptocurrencies including Bitcoin (BTC), Ether (ETH), BNB, Tether (USDT), Monero (XMR) and Zcash (ZEC). Since publishing their donations plea, the news company has received around $250,000 in crypto donations through 146,000 individual transactions. Around 93% of the …
Bitcoin / May 11, 2022
Thanks to Ethereum, 'altcoin' is no longer a slur
Altcoin originally meant “Bitcoin alternative” because, in the early stages of cryptocurrency development, every blockchain-based currency was seen as a sort of Bitcoin (BTC) knockoff. Cryptocurrencies back then were mainly used for payments, such as Litecoin (LTC), XRP (XRP) and Peercoin (PPC). Altcoin was used as a catchall term for cryptocurrencies other than Bitcoin. That’s changed since 2011. With the emergence of more than 20,000 cryptocurrencies, each linked to different types of crypto projects and tokens. We have also seen the dexterity of coins stretch across sectors of public chains, decentralized finance (DeFi), layer 2, decentralized autonomous organizations (DAOs), stablecoins …
Technology / Dec. 4, 2022