Decentralized exchanges largely abandoned the order book. Instead a formula over a pool of two assets determines the price of every trade automatically.
The constant product formula
The common design holds reserves of two assets and requires that the product of the two reserve quantities stay constant through a trade, ignoring fees.
Buying one asset removes it from the pool and adds the other, so the ratio shifts and the price moves. Price is simply the ratio of reserves at any moment.
Larger trades move the ratio further, producing worse average prices. This slippage is a direct arithmetic consequence of the formula rather than a market reaction.
Why arbitrage keeps it aligned
The formula has no knowledge of prices elsewhere. If the pool's ratio diverges from other venues, the pool offers a better price to one side of the trade.
Arbitrageurs take that trade, pushing the ratio back toward the wider market. The pool's price tracks external markets only because someone is paid to make it do so.
The profit arbitrageurs earn comes from the pool's liquidity providers, which is why that cost is discussed alongside the fees those providers collect.
Who supplies the liquidity
Liquidity providers deposit both assets in the required ratio and receive tokens representing their share of the pool, redeemable for a proportional claim on the reserves.
Each trade pays a fee into the pool, increasing reserves and therefore the value of every share. That fee income is the compensation for providing liquidity.
Providers are exposed to whatever the pool holds. As the price of one asset moves, the pool automatically ends up holding more of the one that fell.
What impermanent loss describes
Impermanent loss is the gap between holding two assets directly and holding them inside a pool while their relative price changes.
The rebalancing forced by the formula means the pool sells the rising asset and accumulates the falling one, producing a different outcome than simply holding both.
The term is misleading because the effect only reverses if prices return to their starting ratio. It is a real cost, not a temporary accounting artifact.
Concentrated liquidity and its tradeoff
Later designs let providers allocate liquidity to a chosen price range rather than across all possible prices, concentrating capital where trading actually happens.
Within the range, depth improves substantially for the same capital. Outside it, the position stops earning fees and sits entirely in one of the two assets.
That converts passive provision into an active position requiring monitoring, which is a meaningful change in what supplying liquidity involves.