Think of Uniswap as a digital marketplace where people can trade cryptocurrencies without needing a middleman like a bank or traditional broker. Instead of the usual order books where buyers and sellers place bids, Uniswap uses something called an Automated Market Maker (AMM) to automatically set prices.
An AMM uses mathematical algorithms to figure out the price at which you can buy or sell tokens, and it handles the transaction through something called a liquidity pool. A liquidity pool is basically a collection of tokens that allows users to swap or trade the tokens that are available in the pool.
The liquidity comes from "liquidity providers" - these are other users who deposit their tokens into the pool. In return, they get LP tokens that represent their share of the pool, and they earn rewards through trading fees charged to people who use the pool. Different AMMs use different algorithms, and different pools contain different combinations of tokens.
You can think of impermanent loss as the opportunity cost of adding liquidity to a pool. When someone provides liquidity to a pool, they receive LP tokens that represent their portion of that pool. When they decide to exit, they can exchange those tokens for their share of the pool's current value.
Here's a simple example:
A liquidity provider (LP) contributes $5,000 worth of ETH and $5,000 worth of USDC to a pool and receives LP tokens representing a 10% stake. This means the total pool value is $100,000, and the LP's portion is worth $10,000.
After some time, ETH's price increases by 30%, causing trading activity and price changes within the pool. When the pool rebalances (the AMM algorithm handles this automatically), its value increases to $110,000. At this point, the LP can burn their LP tokens and receive 10% of the pool, which equals $11,000 - earning them a $1,000 profit.
However, if we look at their original investment:
And calculate how those assets would have grown: $5,000 × 1.3 + $5,000 = $11,500
This means their investment would have been worth $11,500, earning a $1,500 profit if they had just held the tokens.
So we can see that by providing liquidity to the pool, they actually earned $500 less than they would have by simply holding. This is impermanent loss.
It's called "impermanent" because ETH's price could fall again and change these numbers. It only becomes permanent when the LP decides to withdraw their funds from the pool.