What Is a Liquidity Pool?
A smart contract holding two tokens that prices every swap with a formula. About $63 billion of swaps went through Uniswap alone in the 30 days to 16 November 2026.

TL;DR
- A liquidity pool is a smart contract holding two tokens that anyone can swap against, with the price set by a formula instead of an order book matching buyers and sellers.
- Uniswap v2's rule keeps the two reserves multiplied together at a constant, x times y equals k, so every token you take out makes the next one dearer.
- In an illustrative pool of 100 ETH and 300,000 USDC, taking 10 ETH costs about 33,333 USDC, roughly 11% over the 3,000 quote, before the 0.3% fee.
- Swappers also face sandwich bots, thin pools around new tokens and code bugs, like the Vyper compiler flaw behind attacks on four Curve pools on 30 July 2023.
A liquidity pool is a smart contract holding two tokens that anyone can swap against, with the price set by a formula rather than by matching buyers and sellers. When a wallet or a decentralised exchange quotes you a price for turning USDC into ETH, the figure often comes from arithmetic run on one of these contracts. The volume is large: swaps worth about $63.1 billion went through Uniswap in the 30 days to 16 November 2026, around $2 billion of it on the latest full day, according to DefiLlama figures read at 13:39 Singapore time on 16 November.
Nobody on the other side is choosing to sell to you. You are trading against two piles of tokens and a rule, and the rule moves the price while you trade. Educational reading only, nothing here is financial advice.
Two piles of tokens and a rule
Ask a pool holding 100 ETH and 300,000 USDC for a price and your screen will show 3,000 USDC per ETH. That is the ratio between the two piles and nothing more, good only for a swap too small to move either of them.
Those piles sit inside a smart contract, where people called liquidity providers deposit both tokens and can withdraw their share later. Everyone else swaps: you send in one token and the contract hands back the other, which shifts both reserves.
A rule written into its code decides how much comes back, and that is why these pools are known as automated market makers. On Uniswap v2 the rule is the constant product. Multiply the two reserves together and you get a number, usually written k, and the contract refuses any swap that would leave it smaller than it was. Written down, x times y equals k.
A worked example, with round numbers
These figures are invented to keep the arithmetic clean.
Take that pool of 100 ETH and 300,000 USDC, which puts k at 30 million. You want 10 ETH, and once they leave the pool holds 90 ETH. To keep the product at 30 million the USDC side has to climb to about 333,333, so you pay about 33,333 USDC.
That is roughly 3,333 USDC per ETH, about 11% above the 3,000 the pool quoted before you started. The swap fee comes on top, and at Uniswap v2's 0.3%, charged on what you send in, the bill rises to about 33,434 USDC.
Your swap has moved the pool's own price as well. It now holds 90 ETH against 333,333 USDC, a ratio of about 3,704, which is 23% higher than where it began, and arbitrage traders will usually sell ETH into it until it lines up with other markets again.
Why the size of the pool decides the cost
Price impact depends on what share of the pool your swap takes. Run the same 10 ETH swap against a pool a hundred times larger, holding 10,000 ETH and 30 million USDC, and you pay about 30,030 USDC. That averages roughly 3,003 per ETH, 0.1% above the quote. Same trade, same formula. The thin pool charged more than a hundred times as much for the move.
The pattern holds at every size: take 1% of a pool's ETH and the average price lands about 1% over the quote. At 10% the premium is already 11%, and someone taking half the ETH pays double the quoted price for it. The last token in the pool can never be bought, because the formula would demand an infinite amount of USDC for it.
That is why a large swap quoted against a small pool can look ruinous. The gap between quote and fill has other causes too, which slippage covers, but in a thin pool the formula on its own can open a double-digit gap, as the example shows.
What the swap fee is
Two quotes for the same tokens can differ because of the pool fee alone. Uniswap v2 charges a flat 0.30% on every pool, but version 3 introduced standard tiers of 0.05%, 0.30% and 1%, which means the same pair of tokens can trade in several pools at different fees.
Version 4 went further and dropped fixed tiers altogether. Whoever creates a pool can set any fee from 0% to 100%. Pools using dynamic fees can change it as often as every swap.
Whatever the rate, you pay it as a cost of swapping, worked out as a percentage of what you send in and already reflected in the quote you see. The network's gas fee comes on top, paid separately for the transaction.
How pool designs have changed
Uniswap's four versions double as a rough timeline.
November 2018, v1. ETH was a mandatory bridge: every pool paired a token with ETH, so swapping one token for another took two hops.
May 2020, v2. Any two ERC-20 tokens could share a pool directly, under the constant product and the 0.30% fee.
May 2021, v3. Concentrated liquidity let deposits sit inside chosen price ranges, so a pool can be much deeper close to the current price than its total size suggests, and thinner further out.
31 January 2025, v4. Every pool moved into one contract, and hooks arrived: add-on contracts that can change how a pool behaves at each stage, fees included.
Curve went another way. Its StableSwap design, set out in a paper by Michael Egorov dated 10 November 2019 and live from early 2020, was built for tokens meant to trade at almost the same price, such as two dollar stablecoins. Near balance its curve behaves almost like a straight line, so the price barely moves, and it bends towards the constant product as the pool becomes lopsided.
What can go wrong for the swapper
Your swap is public while it waits to be included in a block, and sandwich bots use that, buying just ahead of it and selling straight after so you fill at a worse price, a tactic that is a form of MEV.
New tokens bring two more problems, starting with thin pools where modest swaps move the price by large percentages. And whoever deposited a pool's liquidity can pull it out, which is how many rug pulls leave holders with a token there is nothing left to swap against.
Then there is the code. On 30 July 2023, between 13:10 and 22:00 UTC, attackers took funds from four Curve pools: pETH/ETH, msETH/ETH, alETH/ETH and CRV/ETH. The fault lay in the compiler: versions 0.2.15, 0.2.16 and 0.3.0 of Vyper, the language those pools were written in, had a bug that disabled their protection against reentrancy, where a contract gets called back into before it has finished updating its balances.
Losses ran to tens of millions of dollars. Some came back: 2,879.65 ETH pulled out of the CRV/ETH pool by a white-hat address, c0ffeebabe.eth, was handed over to the Curve team, according to a post-mortem by the risk researchers at LlamaRisk. The bug had already been fixed in Vyper 0.3.1, but pools deployed with the older versions still carried it.
None of this shows in the quote. A quote is only the formula's answer for the pool as it stands at that moment.
