I swapped a token last week and there was nobody on the other side
No order book, no seller, no market maker — just a vault, a formula, and a price the machine made up on the spot
I swapped some USDC for ETH on Uniswap last week. I clicked, it filled instantly, and only afterward did it occur to me to ask a question I’d somehow never asked in four years of doing this: who did I buy from?
The honest answer: nobody. There was no order book, no matching engine, no seller waiting with an ask. There was a pool of tokens sitting in a smart contract, and a formula that decided, on the spot, what my purchase should cost. That formula is the entire exchange.
That’s what an automated market maker is — and once you see it as a machine, the word “liquidity” stops being finance jargon and becomes something you can hold in your head.

Part 1: the vault — what a “liquidity pool” actually is
A liquidity pool is just two tokens parked together in a smart contract. Nothing more. Someone (the liquidity provider, or LP) deposits, say, 100 ETH and 200,000 USDC into a contract. From that moment, the contract is a shop: it will sell ETH for USDC or USDC for ETH to anyone, at a price it calculates.
That’s the entire supply of “liquidity” — it’s not some abstract market depth. It’s literally the two numbers sitting in that contract right now. If the pool is small, the shop runs dry quickly and prices swing violently. If it’s deep, prices move gently.
The word “liquidity provider” is doing honest work here: the LP is the person who stocked the shelves. And they get paid — out of the fees you pay on every swap — for taking the risk of keeping those shelves stocked.
Part 2: the invariant — the machine’s only law
Every constant-product AMM (the Uniswap v2 family) runs on a single rule, and it’s the whole engine:
x · y = k
Here x and y are the two token balances in the pool, and k is a constant that must never change. The product of the two balances is frozen.
Think about what that forces. If you buy ETH, you’re removing ETH from the pool (making x smaller), so the pool must take in more USDC (making y bigger) to keep x · y unchanged. The amount of USDC it takes is exactly the price you pay. And because x got smaller and y got bigger, the next buyer pays more. That’s how the price moves — not because anyone set a price, but because the invariant has to hold.
There is no market maker setting the price. The price is whatever the curve says it must be.
Part 3: one swap, walked through the machine
Let’s run a real trade, because the numbers are the clearest way to feel the machine work.
The pool holds 100 ETH and 200,000 USDC, so k = 20,000,000. The price is 200,000 / 100 = $2,000 per ETH.
You buy 1 ETH. After the trade the pool holds 99 ETH. The invariant demands:
99 × (200,000 + what you pay) = 20,000,000
Solve it and “what you pay” is 2,020.20 USDC. So you paid 2,020.20 for one ETH — about 1% more than the listed price. That 1% is slippage, and it’s not a fee the exchange charges; it’s the curve bending under the size of your trade.
| Step | Pool ETH | Pool USDC | Price per ETH |
|---|---|---|---|
| Before | 100 | 200,000 | 2,000.00 |
| You buy 1 ETH | 99 | 202,020.20 | 2,040.61 |
Look at the last column: your own trade moved the price from $2,000 to $2,040. You are the market impact. The bigger your order relative to the pool, the harder the curve bends, and the worse a price you get. This is why tiny pools are dangerous and why “slippage” is a setting you should actually read before you click.

Part 4: the people who keep it fed — and the catch they accept
The LP earns the swap fees (Uniswap v2 charged 0.3% on every trade), distributed in proportion to their share of the pool. It sounds like free money, and for a while it can look like it. But the LP carries a specific risk, and it has a name you may have heard: impermanent loss.
Here’s the shape of it: if ETH’s price moves away from the ratio it had when the LP deposited, the pool ends up holding more of the token that went down and less of the one that went up. The LP’s position is then worth less than if they’d simply held both tokens. The loss is “impermanent” because it can revert if the price comes back — but if it doesn’t, it’s real, and the fees have to outrun it.
I wrote a whole piece walking one ETH/USDC position through this with a live ledger (Impermanent Loss Explained); the short version is: impermanent loss is a comparison against HODL, not money leaving your pocket. The LP is betting that fees beat the gap.
The three ways this machine can hurt you
Because I’d rather you learn this from a paragraph than from a bad trade, the failure modes, in order of how often they bite people:
- 1) Slippage on big orders. The machine’s price is a curve, not a line. A large swap on a shallow pool can cost you several percent before fees.
- 2) Impermanent loss for LPs. Deposit two tokens and watch one moon — you’ll hold less of the winner than you think, and the fees may not cover it.
- 3) Exit liquidity / rug risk. A pool is only as good as the tokens in it. If one side is a token someone can mint or dump, “liquidity” is just a place someone parked the exit.

An AMM has no counterparty. It has a formula, and the formula is wearing a market’s clothes.
Here’s the thing I actually want you to keep: when you trade on an AMM, you are not transacting with a person. You are pushing numbers through x · y = k. The price you pay, the slippage you eat, and the “liquidity” you’re drawing on are all consequences of one frozen product and one curve. Understand the curve and the word “DEX” stops being magic — it becomes a very small machine you can carry around in your head.
Worked example uses the Uniswap v2 constant-product invariant (x·y=k) from the v2 whitepaper (Adams, Zinsmeister, Robinson, March 2020). v3 concentrated-liquidity design from the v3 whitepaper (March 2021). Not financial advice.
(The End)






