Impermanent loss explained with examples
Published on October 27, 2024
Understanding impermanent loss in DeFi through a simple trading card game analogy, followed by a real-world example from Orca DEX where I lost $260 in just four days.
Introduction
Liquidity pools are a cornerstone of decentralised finance, but they come with a unique risk that often catches newcomers off guard: impermanent loss. Whether you're a DeFi beginner or an experienced trader, understanding this concept is crucial. In this post, we'll break down impermanent loss using an easy-to-follow trading card analogy, then examine a real-world case from my personal experience on Orca DEX.
Understanding impermanent loss through Pokemon/Football cards trading example
Imagine you open a trading post at school where kids can trade Pokemon cards for Football cards anytime. That's a liquidity pool.
The special rule of your trading post is: the number of Pokemon cards multiplied by the number of Football cards must always equal the same number (let's say 100). This formula tries to make sure there will always be some cards of each type available - the more someone buys of one type, the more expensive it gets, encouraging others to trade in the opposite direction. It's basically a clever way to make sure the trading post never runs out of either type of card while automatically adjusting prices based on demand.
To start, you put in 10 regular Pokemon cards and 10 regular Football cards, each worth $5. Total value = $100.
Now the World Cup starts, and kids really want Football cards! As they trade Pokemon cards to get Football cards, your trading post's formula kicks in: every trade makes Football cards slightly more expensive and Pokemon cards slightly cheaper. Why? Because after each trade:
- You have fewer Football cards left (making them more valuable)
- You have more Pokemon cards (making them less valuable)
After lots of trades, your trading post might end up with:
- 14 Pokemon cards ($5 each)
- 7 Football cards ($10 each)
Here's where impermanent loss happens: If you had just kept your original cards at home:
- 10 Pokemon × $5 = $50
- 10 Football × $10 = $100
Total = $150
But in your trading post you have:
- 14 Pokemon × $5 = $70
- 7 Football × $10 = $70
Total = $140
You lost $10 in value ($150 - $140) by having your cards in the trading post. It's "impermanent" because if Football card prices drop back to $5, you'll get back to your original position.
Think of your trading post like a scale that must stay balanced - but keeping that balance means you might miss out on some profits you could have made by just holding onto your cards.
Real-World Example: Solana Impermanent Loss on Orca DEX
Now let's take a look at a real impermanent loss case that happened to me recently. A few weeks ago I was looking to participate in a liquidity pool with highly correlated token pair that is not stablecoins. I came across RENDER/SOL pair on Orca decentralised exchange. I decided to deposit about $4k, or 28 SOL at that time, to see how it goes. In the hindsight, it should have started with a smaller amount.
So first I swapped roughly half of my SOL to RENDER.
Then I deposited the SOL I had left and the new RENDER tokens into the liquidity pool.
Note that this was a concentrated liquidity pool position with the price range of about -10% +10%. The initial position's composition was roughly 50% RENDER and 50% SOL.
Fast forward four days ahead and RENDER depreciated in value by about 10% while SOL stayed the same or even gained a little in value. The price correlation of the two assets diverged by more than 10% and my position became out of range.
In concentrated liquidity pools, if your position goes out of range it means two things:
- You stop earning any fees
- Your position consists entirely of the less valuable asset in your pair
My entire position now consisted of 706 RENDER and 0 SOL. At this point I had a few options:
- Do nothing, keep the position and hope the price correlation returns
- Close the position, swap some RENDER to SOL and reopen the position with a new price range
- Close the position, swap back all RENDER to SOL and not come back
I wasn't impressed by either RENDER's price performance or the pool's APR. Although the position earned $27 in fees over 4 days (see last screenshot), which would have been decent for a highly correlated pair, the tokens weren't as correlated as I had hoped. So I chose the last option and quit. Swapping all my RENDER back into SOL gave me 26 SOL. This resulted in my first impermanent loss becoming permanent and realised: 2 SOL, or about $260.
In the following weeks RENDER price did not recover and SOL gained about 20%, so my call to withdraw was a good call. Had I chosen to keep the position, my impermanent loss would have only grown bigger.
Conclusion
These two examples demonstrate how impermanent loss can affect liquidity providers in different contexts. While the trading card analogy helps us understand the basic mechanism, my Orca DEX experience shows the real-world implications - a seemingly safe position in correlated tokens resulted in a 7% loss ($260) in just four days.
Key takeaways:
- Impermanent loss occurs when token prices move out of their initial ratio
- The loss becomes permanent or realised if you choose to exit the position
- Sometimes you earn more (or lose less) by just holding an asset and doing nothing
Remember: while impermanent loss can become permanent when you exit a position, the profits from trading fees can sometimes offset these losses. However, as shown in my case, low trading volume or brief holding periods might not generate enough fees to make it worthwhile.
And lastly, don't be like me, start with smaller amounts when testing new liquidity pools and strategies! :)