How an automated market maker sets a price
There is no order book and no counterparty quoting you. The price comes out of a formula and the size of the pool, which explains most of what feels strange about trading on one.
✓ No affiliate links in this guide
On a conventional exchange a price exists because someone is offering it. On an automated market maker nobody is offering anything: the price is a consequence of arithmetic applied to the contents of a pool. Understanding that one substitution explains almost everything that feels counter-intuitive about trading in decentralised markets.
The pool and the invariant
A pool holds two assets. The most common design maintains a simple relationship: the product of the two quantities stays constant through any trade. Deposit some of asset A and the pool must return exactly enough of asset B to keep that product unchanged.
The price you receive falls out of this automatically. Because the product is fixed, taking B out of the pool makes each remaining unit of B more expensive in terms of A. No quote is published and no counterparty agrees to anything; the formula alone determines the exchange rate at every moment.
Why the price moves against you within a single trade
This is the part that surprises people. On an order book, a small trade executes at the posted price. On an AMM there is no posted price — there is only a curve, and your trade moves along it.
The rate at the start of your trade is better than the rate at the end, and what you actually receive is the average across the whole move. The larger your trade relative to the pool, the further along the curve you travel and the worse that average becomes. This is not a fee and nobody charges it to you; it is a structural property of pricing from a formula.
It follows that the same trade is cheap in a deep pool and expensive in a shallow one, and that the pool’s size matters more than the headline fee. Our glossary entry on slippage covers the effect; the cause is here.
What keeps the pool price near the wider market
Nothing inside the pool knows what an asset is worth elsewhere. If the outside market moves, the pool is briefly mispriced, and arbitrage is the only mechanism that corrects it.
Someone notices the discrepancy, trades against the pool until the formula’s price matches the outside market, and keeps the difference. That profit is not extracted from thin air: it comes from the value of the pool, which is to say from the people who deposited into it. Arbitrage is a service the pool pays for continuously in order to stay aligned with reality.
Where impermanent loss comes from
This also explains the loss that liquidity providers experience when prices diverge. Because arbitrageurs continuously rebalance the pool towards the outside price, a depositor always ends up holding relatively more of whichever asset performed worse.
The result is that a pooled position tracks something close to the geometric mean of the two assets’ performance while simply holding them tracks the arithmetic mean, and the geometric mean is never larger. The gap between the two is impermanent loss — arithmetic, not a fee, and calculable in advance with our impermanent loss calculator.
What fees are actually for
Trading fees on an AMM go to the depositors, not to an operator taking the other side. They exist to compensate for the loss described above. Whether providing liquidity is worthwhile therefore reduces to a single comparison: do the fees earned exceed the divergence loss over the period you were in the pool?
That comparison is knowable before you deposit, at least approximately, and is the calculation most people run only afterwards.
What the design does not do
An AMM removes the need for a counterparty, a matching engine and a custodian. It does not remove price risk, it does not guarantee a fair price relative to the wider market at any given instant, and it does not protect you from depositing into a pool whose contract has a flaw. The pricing mechanism is elegant and completely indifferent to whether the assets in it are worth anything.
Concentrated liquidity changes the curve, not the principle
Later designs let a depositor choose the price range in which their capital is active rather than spreading it across every conceivable price. Within that range the pool behaves as though it were far deeper, so trades incur less price movement for the same amount of capital.
The trade is that capital outside its range earns nothing. If the price leaves the band you selected, your position converts entirely into one of the two assets and sits idle until the price returns. This turns providing liquidity from a passive decision into an active one, with a view about range attached, and it means the losses can be considerably sharper than in the simple design.
The underlying mechanism is unchanged: a formula plus balances, with arbitrage aligning it to the outside market. Only the shape of the curve is different.
What a quoted rate does not include
Before confirming a trade, most interfaces show an expected rate. That figure typically accounts for the curve, and it typically does not account for what happens between your seeing it and the transaction settling.
Other trades execute in the meantime and move the pool. On congested networks the gap can be substantial. This is why interfaces ask for a slippage tolerance: it is the amount of adverse movement you will accept before the transaction reverts rather than filling at a materially worse price.
Setting that tolerance high to avoid failed transactions is a common and expensive habit. A wide tolerance is an instruction to fill at almost any price, and on a thin pool that is exactly what can happen.
Pool depth matters more than the fee tier
Given a choice between a pool with a lower fee and one with substantially more liquidity, the deeper pool is usually cheaper for anything but a very small trade. The fee is a fixed percentage; the price movement along the curve grows with your trade size relative to the pool.
The practical check before trading is therefore not the advertised fee but the size of your trade as a fraction of the pool. A trade that is a rounding error against pool depth costs roughly the fee. A trade that is a noticeable fraction of it costs the fee plus a great deal more, and the difference is entirely predictable in advance.