What a Liquidity Pool Is, and Who Is on the Other Side

There is no order book and nobody matching buyers to sellers. Every trade you make onchain is against a contract holding two piles of tokens, and somebody owns those piles.

What a Liquidity Pool Is, and Who Is on the Other Side

The short answer

A liquidity pool is a smart contract holding reserves of two tokens that anyone can trade against. There is no order book and no counterparty waiting to take your side: the contract prices the swap from the ratio of what it holds, using a formula, and updates that ratio after every trade. The reserves are supplied by liquidity providers, who deposit both tokens and earn a share of the fee on every swap in return. That is why a trade on a thin pool moves the price so much – you are not meeting a seller, you are changing the contents of a pool, and the price is a function of those contents.

On a traditional exchange your buy order meets somebody's sell order, and if nobody is selling, nothing happens. Onchain there is usually no order book at all. You trade against a contract, and the contract always has a price.

What is inside one

Two reserves. A pool for a token against ETH holds some quantity of each, and its price is simply the ratio between them. Buy the token and the contract hands you some from its reserve and takes your ETH into the other side; the ratio shifts, and so does the price, immediately and mechanically.

The common formula keeps the product of the two reserves constant, which is why it is called a constant-product market maker. It has one useful property: it can never run out. As the reserve of a token shrinks, its price rises without limit, so there is always a price at which a trade is possible – just not always one you would accept.

Why your trade moves the price

This is the part that surprises people arriving from exchanges. The price shown is the price for an infinitely small trade. Yours is not infinitely small, and the bigger it is relative to the reserves, the further along the curve you travel. The difference between the quoted price and what you actually get is price impact, and it is not a fee anyone charges – it is the shape of the curve.

Where the tokens come from

Liquidity providers. Somebody deposited both sides, and in return holds a claim on a share of the pool and on the fees it collects. Every swap pays a percentage – 0.05%, 0.30% or 1% on Uniswap depending on the tier – and that goes to whoever supplied the liquidity being traded against.

So a pool is not infrastructure that simply exists. It exists because it pays somebody to exist, and it stops existing when it stops paying them.

Who is actually in a swap – the three parties
Who is actually in a swap – Nobody on the other side is a person deciding to sell to you

Concentrated liquidity, in one paragraph

Older pools spread liquidity across every possible price, including prices nothing will ever trade at. Uniswap v3 and v4 let a provider choose a range, concentrating their capital where trading actually happens. The result is much deeper liquidity near the current price and none at all outside somebody's chosen range – which is why a token can look deep and then become thin the instant it leaves the band everyone chose.

What this means when you trade

  • Read the pool's liquidity, not just the token's price. The first tells you what your exit is worth.
  • The same trade costs more on a thin pool than a deep one, and the cost is not a line item anywhere.
  • Liquidity can leave. Unless the position is locked or burned, the reserves you are relying on belong to somebody who can withdraw them.
  • Several pools can exist for the same token at different fee tiers, with different depth. Aggregators exist because of this.
  • A price with nothing behind it is just a number. On a pool with a few thousand dollars of liquidity, the market cap on the screen is fiction.

The question worth asking before any onchain trade

Not what is the price, but how much is in the pool, and can it give me back what I am about to put in. Everything else about pools follows from that one number.

Tools mentioned

FAQ

What is a liquidity pool in crypto?

A smart contract holding reserves of two tokens that anyone can swap against. It prices each trade from the ratio of its reserves rather than by matching you with a seller, and the reserves come from liquidity providers who earn a share of the fee on every swap.

Who is on the other side of a DEX trade?

No one, in the sense of a person choosing to trade with you. The contract is the counterparty and it always quotes a price. The people involved are the liquidity providers who supplied the reserves, and they are not deciding anything at the moment you trade.

Why does my trade move the price so much?

Because you are changing the reserves the price is computed from. The quoted price applies to a trade of negligible size; yours travels along the curve, and the further you travel the worse the average price. On a pool with little liquidity even a modest trade travels a long way.

More from the blog