What are liquidity pools?
Liquidity pools are automated programs where users deposit cryptocurrency in exchange for fees generated when others trade or borrow with their liquidity. If you have a crypto wallet, you can add funds to a liquidity pool and collect token rewards. You'll often find liquidity pools on DeFi applications like DEXs and decentralized lending platforms. People who deposit tokens on liquidity pools are often called "liquidity providers" or "yield farmers."
The deposited funds in a liquidity pool are open to DeFi traders and investors. For example, liquidity pools on the DEX Uniswap allow people to make trustless peer-to-peer token swaps. The liquidity pools on the DeFi lending site Aave allow users to borrow crypto by depositing digital collateral.
Rather than relying on centralized brokers or banks, liquidity pools use coded smart contracts to fulfill commands. When a smart contract's conditions are met, it automatically executes its programmed response.
The liquidity pools on DEXs run on algorithms that ensure a specific relationship between the price of two tokens. For instance, Uniswap uses the following formula:
x*y = k––where "k" is a constant and "x" and "y" refer to the value of the pool's two cryptocurrencies.
Although liquidity pools need to maintain a constant value, crypto prices are anything but constant. As digital asset prices in a liquidity pool rise or fall, traders cash in on this trend by buying or selling tokens from the DEX. This trading practice is known as "arbitrage," which helps naturally correct the token supply in a liquidity pool.
This is where impermanent loss enters the picture.
So what is impermanent loss?
As traders change the supply of tokens in a liquidity pool, a liquidity provider's share of tokens will change versus their initial deposit. Even if the deposit's dollar value goes up, thanks to a token's increase, liquidity providers would have made more if they held their tokens.
You can calculate impermanent loss in crypto by subtracting the current market value of their initial deposit versus the dollar value of their share of tokens in a liquidity pool. For example, suppose you initially deposited 1 Ethereum (ETH) and 2,000 USDC, but your current share of a liquidity pool is 0.816 ETH and 2,449 USDC. In that case, you'd have to multiply today's market value of ETH by 1 and 0.816, add it with the associated USDC value, then subtract the difference.
Assuming ETH's price rises to $3,000 in the above example, that would give you a liquidity pool impermanent loss of $103. Here's a step-by-step breakdown of how we derived this number:
- Value if you held your initial investment: (1 ETH x $3,000) + 2,000 USDC = $5,000
- Current value in liquidity pool: (0.816 ETH x $3,000) + 2,449 USDC = $4,897
- Difference between the two: $5,000 - $4,897 = $103
Impermanent loss explained with an example
To better illustrate impermanent loss, let's take a look at an example of a token pair on Uniswap.
Let's assume you deposit 1 Wrapped Bitcoin (wBTC) and 20,000 DAI into a wBTC/DAI pair. Since DAI is a stablecoin, the value of wBTC must be worth $20,000 when you deposit this pair into Uniswap. Token deposits on Uniswap need to have a 50/50 split.
Suppose the price of wBTC falls to $18,000 per coin. Here, arbitrage traders would deposit more wBTC into the DEX from other exchanges to take advantage of the price change.
The algorithms that account for supply fluctuations can vary between protocols. Also, factors like your daily token rewards and your percentage of the pool will influence the crypto you have day by day. It’s important to use an online impermanent loss calculator that adjusts according to your protocol’s algorithm.
However, your share of wBTC will rise as the price falls and arbitrage traders increase the pool's wBTC supply. Conversely, the amount of DAI you hold will decrease as your wBTC percentage increases. Thirdly, since this pool is on Uniswap, you must have a 50/50 ratio of wBTC to DAI in USD terms.
Therefore, you may have 1.054 wBTC and 18,973.66 DAI.
1.054 wBTC * current coin value of $18,000 = $18,973.66.
In this case, your total USD value in the liquidity pool is $37,947.32 ($18,973.66 + $18,973.66 = $37,947.32)
To calculate impermanent loss, you need to figure out how much your 1 wBTC and 20,000 DAI would be worth now that wBTC is trading for $18,000:
(1 wBTC x $18,000) + 20,000 DAI = $38,000
Therefore, if you held your wBTC and 20,000 DAI, you would have lost $52.68 less than in the liquidity pool ($38,000 - $37,947.32 = $52.68).
Are there ways to avoid impermanent loss?
Although you can't "avoid" impermanent loss when depositing volatile cryptocurrencies, here are three best practices that might help reduce its impact:
1. Use protocols with Impermanent Loss Protection (ILP)
A few DeFi protocols, like Bancor and ThorChain, have introduced a program called Impermanent Loss Protection (ILP) to reduce the impact of impermanent loss. ILP aims to guarantee liquidity providers will at least break even when they decide to withdraw from a liquidity pool. To do this, ILP will subsidize any lost value due to impermanent loss by using the DeFi protocol's treasury.
However, liquidity providers won't enjoy 100% protection on day one. Most ILP programs only reward 1% of protection per day. This means you need to keep your token pair in a liquidity pool for 100 days to ensure you get back 100% of your initial investment.
Also, ILP programs won't give extra funds if the revenue a liquidity provider receives meets or exceeds their initial investment. In other words, if the dollar value of the token rewards you received matches the amount you initially deposited in the liquidity pool, you won't get ILP protection.
2. Only use low-volatility trading pairs
A simple way to reduce the risk of impermanent loss is to focus on token pairs with low volatility. The less volatile the cryptocurrencies are, the lower chance you’ll experience significant impermanent loss.
Since stablecoins like USDT, DAI, and USDC maintain a 1:1 ratio with USD, they’re the least volatile cryptocurrencies. Unless the stablecoin project you choose fails, your initial deposit in a stablecoin token pair should remain constant.
Besides stablecoins, liquidity providers can consider depositing into wrapped token pairs. Wrapped cryptocurrencies are used to transfer non-native tokens to alternative blockchains. The value of a wrapped crypto should always be the same as the underlying asset. For instance, the value of 1 ETH should always equal 1 wrapped ETH. Although the price of ETH is more volatile than a stablecoin, an ETH-wETH pair should be worth the same market price at all times.
While you can pair these low-volatility tokens on any DEX, Curve Finance is well-known for offering stablecoin and wrapped token pairings.
3. Consider multi-asset liquidity pools
Most DEXs rely on 50/50 token pairs, but a few DeFi platforms enable users to mix up their token percentages. Notably, the DeFi protocol Balancer uses "weighted pools" that give liquidity providers greater flexibility in the tokens they can supply. Instead of providing a 50/50 token split, users on Balancer can add multiple digital assets at varying percentages.
While this strategy doesn't eliminate impermanent loss, it helps liquidity providers better manage their risk. For example, you can create a Balancer portfolio with 80% in stablecoins and 20% in ETH. You can also add more than two tokens to an account on DeFi sites like Balancer, which may mitigate the effects of impermanent loss.
Impermanent loss only becomes permanent when liquidity providers decide to withdraw their tokens. There's always a chance that crypto prices will readjust to levels that are closer to your initial investment. Remember, liquidity providers will constantly earn token rewards on their platform, and the percentage of crypto rewards a yield farmer collects may offset impermanent loss.
At Worldcoin, we aim to make the concept of cryptocurrency easy for everyone. We intend to put a share of our crypto in the hands of every individual on the planet for free. Subscribe to our blog to know more.