gt defi tutorials

There's Free Money Sitting in Every Liquidity Pool. So Why Don’t You Take It?

There's Free Money Sitting in Every Liquidity Pool. So Why Don’t You Take It?

The arbitrage mechanism behind impermanent loss, and how your money gets drained by it


There's a basic AMM question I struggled with for far too long.

ETH trades at $8,000 on Binance. But the pool still prices it at $2,000.

Someone can simply buy cheap ETH, then turn around and sell it at a profit of 4x. It's free money.

Why not an arbitrage bot that just sweeps all the ETH from the pool?

It's not "high gas fees" or "slippage". It's a matter of mechanics — and once it clicks, you suddenly have a concrete understanding of impermanent loss.

Let me show you.


Setup

We'll go with a classic constant-product pool. ETH is priced at $2,000.

  • 10 ETH
  • 20,000 USDC
  • k = 10 × 20,000 = 200,000

The invariant x × y = k must hold true for each trade. That's the one rule that does all the work.

Initial pool TVL: $40,000.


The price mechanism

Here's the key misunderstanding.

A pool doesn't know its price. It doesn't even check an oracle to find out — it has no way of knowing anything about prices outside itself.

Price is completely defined by the ratio of its two assets:

Price = USDC balance ÷ ETH balance
      = 20,000 ÷ 10
      = $2,000

That's all it takes.

And since the price depends on the ratio, every trade changes the price, because every trade changes the ratio. Buy ETH from the pool, and there's less ETH but more USDC — so the next ETH becomes more expensive.

The price rises along the process, not after.


Let's do the arbitrage

ETH is now at $8,000 on Binance. But our pool says $2,000

Our bot starts buying ETH from the pool. What happens with its price as it keeps going?

53f1dc06c8d51f8483a6e3220d3f647816301a66d43ea9bf5bdf9e52c58cf070.png

Each row multiplies to 200,000. That's the rule. At 5 ETH purchased, the pool price equals $8,000.

The bot stops at that point.

Another ETH purchase would bring the price up to $12,500 — meaning it becomes unprofitable at the exact moment when the prices equalize.


Why is there still ETH in the pool?

5 ETH remained in the pool — that's half of the initial supply.

The bot hasn't run out of ETH. It has stopped because the price hit the point of parity.

That's the whole explanation. The stop criteria isn't quantity, it's price.

There's a simple hidden principle at work here:

If the price multiplied by 4, the pool will have half of the ETH but twice the USDC.

Since 4 = 2 × 2, the pool divides that change equally between two assets.

It's the same for any change. Price ×9 means ETH ÷3 and USDC ×3. Price ×100 means ETH ÷10 and USDC ×10.

The pool always takes the square root of the price change and apportions it to the two assets. And this is why it cannot ever be fully drained — you need infinity to reduce the ETH share to 0.


Where does the bot sell its ETH?

On Binance, Coinbase, or another DEX — anywhere with plenty of liquidity.

This is the fundamental asymmetry. You are trading in a shallow pool, where a single trade shifts the price considerably. But on Binance, there's deep liquidity where it makes absolutely no difference.

Your bot buys from the shallow liquidity source and sells to the deep liquidity source.

P&L of the bot:

Bought:          5 ETH
Paid:            40,000 − 20,000 = 20,000 USDC
Average price:   20,000 ÷ 5      = $4,000 per ETH

Sold 5 ETH at the real price of $8,000 = $40,000

Profit: $40,000 − $20,000 = $20,000

Time for the bad news

That $20,000 came from somewhere.

Let's check the liquidity provider's position once ETH is at $8,000:

Pool position:
5 ETH × $8,000    = $40,000
40,000 USDC       = $40,000
                  ─────────
Total               $80,000
The same amount if held:
10 ETH × $8,000   = $80,000
20,000 USDC       = $20,000
                  ─────────
Total              $100,000

The difference: $20,000.

Exactly the same number as bot's profit.

Impermanent loss is not a fee, a penalty, or some kind of mathematical anomaly. It's the arbitrageur's profit directly extracted from the liquidity provider.


In English

No formulas. Here's what happened:

You have started with 10 ETH. You've ended up with 5 ETH.
The pool has sold your 5 ETH on the way up, at an average price of $4,000 per ETH.

When the sale was done, the ETH price was $8,000.
You have lost 5 ETH for $4,000 each.

5 × $4,000 = $20,000.

That's impermanent loss. It isn't any sort of punishment or mystery — it's the difference between the price the pool sold your ETH for and the price it ended up at.

The pool sold your winning ETH too early, and the bot made that profit.

How the loss amounts to 20%

Against a starting position of $100,000, $20,000 represents a 20% loss.

You don't need the formula to get there, but if you want to use it anyway:

IL = 2√k ÷ (1 + k) − 1

For a 4x price change (k = 4):
2 × 2 ÷ 5 − 1 = 0.8 − 1 = −20%

$100,000 × 20% = $20,000

Why this is a feature, not a bug

It's easy to consider arbitrageurs parasites. They are not.

They are the very reason the pool has the right price at all. 

No one updates it at Uniswap. There's no oracle feeding it the information. The pool has no idea about the actual price.

Arbitrage is the whole price discovery mechanism, and it works via self-interest. A gap appears, it gets closed by a profit-seeking trader, and the price becomes correct — and usually very quickly, sometimes even within a single block.

The cost of that service is borne by liquidity providers, and the compensation is trading fees.

Which means that LP should ask themselves the following question:

Are the fees I earn greater than what arbitrageurs take from me?

Not "what's the APY."


Practical implications for liquidity providers

Volatility is your enemy, not the direction. It's the same formula, and the cost of loss depends on how much the price moved away from the entry, not whether it went up or down.

Stablecoin pairs work because the prices barely diverge. USDC/USDT has very little arbitrage gap, and so most of the earned fees remain with the liquidity provider. That's why these pairs look boring and work reliably.

Trending assets are the worst case. The loss compounds proportionally to the price distance:

67c7b8e91dc5247005a374e8352938fe27c513fd82b1bbbf3b29ab3c134bd7af.png

If your assumption is that the token will appreciate 10x, then LP position is the absolutely worst way to hold it. You'll lose 42.5% of the profit to arbitrageurs working with your pool.

"Impermanent" loss is doing a lot of work in that word. It becomes permanent if the price never returns to your entry ratio. You just haven't realised it yet


The one-line version

An AMM is a machine that mechanically sells your winners and buys your losers, and pays arbitrageurs to make it.

If there's price oscillation, it makes absolute sense — you get dips and peaks for free, and you earn fees.

But if there's trending, then this mechanism works opposite of what you want, and its effect compounds on each leg.

Prices in crypto trend far more often than revert — adjust your positions accordingly.

How do you rate this article?

1



gt defi tutorials
gt defi tutorials

Software engineer taking apart crypto mechanisms. I ask why until the maths makes sense, then write it down. DeFi, yields, and where the money actually comes from.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.

Page not displaying correctly?