If you missed it, here’s the previous piece explaining how numbers get bent through price impact. Today, we’re taking a bird’s eye view of impermanent loss. It's a subtle phenomenon that can be hard to see in your day-to-day trading, but can mean the difference between profits and losses.

This is part of an ongoing series of posts designed to explain the world of Web3 and orient users as to how to use it, and how to use it safely. We’ll be covering topics ranging from the technical to the humorous. Follow along and you’ll be a savvy, safe MetaMask power user in no time.

As discussed previously, there is a huge number of crypto projects today that involve depositing pairs of tokens into liquidity pools. In fact, a large proportion of Decentralized Finance (DeFi) activity revolves around liquidity pools at one level or another. Most ‘staking’ or ‘farming’ activity that you hear about is actually a secondary level of earnings or depositing of tokens on top of an initial pool deposit.

For those who are still fuzzy on it: a ‘liquidity pool’ is an automated mechanism that allows trading between two crypto tokens. Those who contribute to the pool ‘stake’, or deposit, matching values of the two different tokens into the pool. They then earn a proportional percentage fee for each transaction carried out by pool customers; those that are trading that token pair. This is the process that incentivizes token holders to prop up the markets on platforms such as Uniswap or SushiSwap.

Automating this kind of process through code may seem logical, but it’s important to remember that in the history of finance, this is a truly novel, revolutionary way of doing things. Before the 1990s, market orders—sell, buy, and all the rest—were at some level human-executed. It was Shearson Lehman & Brothers who first pioneered wholesale replacing of human work through machine automation in finance, introducing automated market makers (AMMs). A truly decentralized application goes one step further; after all, the AMM software of the 90s consisted of internal products for the benefit of their firms. A truly decentralized exchange, on the other hand, is outside of the control of any one entity; its code is open to the world, for anyone to use.

In theory, this sounds like a great way to passively earn tokens in the medium term: you buy some stablecoins, you deposit them into a pool along with some ETH, and boom, you’re earning money. Right? Well…

There’s a ‘gotcha’. And it’s not a simple one. This one has the distinctly unfriendly name of “impermanent loss.” What the heck is that?

An example of impermanent loss

In truth, the name of this phenomenon is something of a red herring. Both of its constituent elements—‘loss’ and ‘impermanent’—only apply in certain circumstances. No spoilers yet: to contextualize this statement, we have to wade through the math first. 

Let’s walk through a made-up example. Our friend, Paco, got into crypto, started learning about DeFi, and decided he wanted to support the markets and earn from his tokens. At the time, ETH had a price in USD of $2500. So he went to his favorite decentralized exchange (DEX), and deposited 1 ETH, and $2500 in stablecoins, into a liquidity pool. He had put a total of $5000 in value into the pool.

Since Paco isn’t interested in actively day-trading, he’s something of a passive investor: he just wants to let the liquidity pool do its thing and collect his profits.

But eventually, the price of ETH doubled. It wasn’t $2500 anymore, but $5000. Paco thinks, ‘Huh, I wonder how my liquidity pool position is doing’. What Paco finds when he opens the DEX app is approximately $3535.50 in stablecoins, and 0.7071 ETH. Paco is happy about the increase in stablecoin value, but disappointed to see his precious ETH dropping. After all, investing in a liquidity pool was about gaining tokens, right?

Here’s the thing about liquidity pools: the assets you deposit are matched in value, not in quantity. If the value of one of the assets changes relative to the other, the quantity you hold needs to change in order to match the unchanged value of the other. The ratio of the two token types in the pair is adjusted accordingly.

This is why, in our example, the quantity of stablecoins Paco holds has to increase, and the quantity of his ETH has to decrease. They adjust to match each other in value: note how 0.7071 ETH is almost identical in value (at a market price of $5000 per ETH) to $3535 of dollar-pegged stablecoins. (For an overview of the math behind this, see this explainer.) 

But how do these changes actually come about? It wouldn’t make sense that everywhere else, 1 ETH is worth $5000, but for Paco, it’s $2500. The market—and more specifically, traders engaging in the activity known as arbitrageenforce that market price, essentially by buying Paco’s “cheap” ETH and selling it for a profit at now-current market prices. This is one of the underlying forces which generate “market prices”. 

In our example, arbitrage traders have bought the cheaper ETH from Paco’s pool using the other half of its trading pair, a stablecoin, until there was no surplus value left for it to be profitable for them. The ratio of the token pair in the pool was corrected for the new ETH price of $5000 by pumping in more stablecoins and removing almost 0.3 ETH.

An essential point to understand here is that, had Paco not deposited his ETH, and just held it, then he would still have $2500 in stablecoins, and $5000 in ETH – a total of $7500 in value. But instead, he’s got $3535, give or take, in ETH, and a similar amount in stablecoins, totalling $7071 at current market prices. 

The $429 difference between these sums is Paco’s impermanent loss. However, and as the name indicates, it’s only “impermanent” until Paco removes his holdings from the poolat that point, all losses and earnings become permanent.

Paco’s loss is relatively large, at the best part of 10% of the dollar value he initially put in. That’s not to say, though, that impermanent loss is always substantial: it depends on the degree to which the price changes, whether upwards or downwards. Both directions result in impermanent loss, because in either case the ratio of your tokens will need to be adjusted. Common to both price increases and decreases though, is the fact that impermanent loss moves roughly in proportion with price changes.

So, has Paco lost value? Maybe. It depends. 

It’s fair to say there’s a lot of moving parts here. The question of how much Paco has ‘lost’ depends on a lot of factors: 

  • What were the relative prices of the two assets at the beginning, and what are they now? 

  • What percentage of the liquidity pool did Paco’s holdings represent, and how long was he in the pool, and how much trading volume did the pool have? 

  • How much of his potential profits are swallowed up by transaction fees?

  • Most importantly in this context: will Paco actually realize the impermanent loss by withdrawing his liquidity from the pool?

Depending on all these factors, in addition to the terms and conditions of the pool itself, Paco may have earned a lot of value in the form of trading fees. Maybe these profits amount to more than what he lost in the form of impermanent loss.

In any case, Paco has a choice: rather than withdrawing and making his potential loss permanent, he can keep the value locked in the pool and continue to earn the corresponding proportion of fees. After all, maybe the value of the token will come back down to where it was when he made the deposit, at which point he has retained all his value and earned from the transaction fees.

It turns out it is not at all uncommon to lose money from your principal investment in liquidity pools. Researchers at Cornell University reported in November 2021 that 43% of users of Uniswap v3, the largest Ethereum mainnet swaps platform, lost money on their liquidity pool stake due to impermanent loss. They also conceptualize impermanent loss as the risk you take on in return for your share of the pool’s profits. As the saying goes: there’s no such thing as a free lunch.

As always, this isn’t supposed to be trading or financial advice. The take-away here is: if you’re engaging in activities surrounding liquidity pools, and you feel like the balance in your LP position isn’t right, take a moment to do the math and figure out what the starting price is, and what it is now. You’ll still have your initial value… you just may not have your initial quantity.

Stay tuned for more updates, and remember: stay foxy out there...