Order books and automated market makers
The same trade size, on two kinds of venue, produces two costs that behave differently as the size grows. On one, the cost depends on who happens to be resting nearby. On the other, it is a fixed function of the size and can be calculated exactly in advance.
The two designs answer the question “at what price” in fundamentally different ways. An order book asks other participants and matches you against their answers; an automated market maker computes an answer from a formula and a pool of assets. Almost every difference in how they behave follows from that.
What an order book requires
A limit order book needs someone to be willing to post a price before you can trade at it, and depth is contributed by participants who choose the prices and withdraw whenever they like. So depth is discretionary — there is no guarantee anyone is quoting, and quotes widen or disappear when the risk of resting rises — and the price of any size is unknowable in advance beyond what is displayed, because displayed depth is a lower bound on a state that changes continuously.
What an AMM replaces
An AMM removes the counterparty from the moment of trade. Instead of matching two participants, it holds reserves of both assets in a pool and quotes a price derived from the ratio of those reserves by a fixed rule.
The most common rule is a constant product: the product of the two reserve quantities is held constant across a trade. You add some of one asset, the formula computes how much of the other you may remove such that the product is unchanged, and the ratio of what you gave to what you got is your price.
Three properties fall out immediately. There is always a quote — for any size, at any moment, the formula returns a number, and nobody has to be willing. The quote is deterministic: given the reserves, your price for any size is calculable exactly before you trade, with no queue, no priority and no uncertainty about the other side. And the price is a function of the reserves only — the formula does not know what anything is worth, only the ratio it currently holds, and it will quote confidently at any ratio.
Where the price comes from, and where it doesn’t
That third property is the one worth dwelling on. An order book’s price is an aggregate of opinions — someone chose 40,000 as a bid. A pool’s price is a mechanical consequence of its inventory ratio, with no opinion in it at all.
What makes it resemble anything external is the same mechanism that links two order-book venues: participants transacting against the pool when its quote differs from prices available elsewhere, moving the reserve ratio as they do. Which makes the pool a price taker dressed as a quoter — it tracks external prices as closely as that flow keeps it tracking and no more closely, and between such trades the quote is wherever the last trade left the ratio.
Cost as a function of size
This is where the two designs feel most different in practice.
On a book, your cost for a size depends on how quantity happens to be distributed across levels, which is lumpy, asymmetric and changing. A small order may cost nothing above the touch; the next increment may cost a lot, because the level ran out. On a pool, cost rises smoothly with size according to the curve, with no levels and no gaps — and the concession is structurally the same thing as slippage: the price you get is worse than the price displayed, by an amount that grows faster than linearly.
Both designs also charge a fee, and where it goes differs. A book venue’s fee goes to the venue, split by maker and taker roles. A pool’s fee is generally added to the reserves, accruing to whoever contributed them, and the rate and treatment vary by implementation and are not something this site quotes.
The mechanism
THE MECHANISM — book versus pool
· You want to trade on a book
→ matched against someone else's
resting order, at their price.
· You want to trade against a pool
→ priced by formula from the
reserve ratio. No counterparty
decision involved.
· Nobody is quoting
→ a book can be empty. A pool still
returns a price for any size.
· Cost as size grows
→ lumpy and unknowable on a book;
smooth, superlinear and exactly
calculable on a pool.
· A pool's quote versus outside prices
→ NO MECHANISM forces agreement.
It tracks only as closely as
arriving flow drags it.
· Contributing reserves to a pool
→ your holdings are rebalanced
toward whichever asset is falling.
NO FREE SIDE.
· Formula used, fee rate and treatment,
concentration features and how reserves
are accounted
→ VENUE-SPECIFIC. Constant product
is one rule among several.
Worked example
Illustrative figures, synthetic throughout, and chosen so the arithmetic is checkable by hand.
Suppose a constant-product pool holds 100 units of the base asset and 4,000,000 units of the quote asset. The product is 400,000,000, and the ratio implies a price of 40,000 quote per base.
Buying 1 unit of base. The base reserve must fall to 99. To keep the product at 400,000,000, the quote reserve must rise to 400,000,000 ÷ 99 ≈ 4,040,404. So you pay about 40,404 quote for 1 base — roughly 1% above the starting price of 40,000. Fees are additional.
Buying 5 units. Base reserve falls to 95, quote reserve rises to 400,000,000 ÷ 95 ≈ 4,210,526. You pay about 210,526 for 5 base, an average of about 42,105 — roughly 5.3% above the starting price. Five times the size, and more than five times the concession per unit.
And afterwards the quote has moved. After the 1-unit purchase, the reserve ratio is 4,040,404 ÷ 99 ≈ 40,812, so the pool’s next quote starts from there — the trade moved the price by construction, exactly as an order consuming levels on a book does, except that here the amount was a known function rather than a consequence of who happened to be resting.
What contributing reserves does, mechanically
Reserves come from participants who deposit both assets. The formula then trades against them automatically, in a specific direction, and the direction is worth stating plainly.
Because the pool sells whichever asset is becoming more expensive and buys whichever is becoming cheaper, a contributor’s holdings are continuously rebalanced toward the asset that is falling in relative terms. Compared with simply holding both quantities unchanged, the pool position ends up with less of the one that rose and more of the one that fell, and the divergence grows with the size of the relative move. This is commonly called impermanent or divergence loss; the word “impermanent” only means it reverses if the relative price returns to where it started, which is not a property anyone can rely on.
Fee accrual runs the other way, adding to reserves over time. Whether the two effects net out for any particular pool over any particular period is not something this site will estimate. The mechanical statement, and the only one that generalises: contributing reserves means accepting an automatic rebalancing you do not control, in exchange for a share of fees you cannot know in advance.
The failure mode
Each design fails in the way its strength suggests it cannot.
A book’s weakness is availability. Depth is discretionary, so it can be absent, and it is thinnest when most needed. Its strength is that you are matched against a real participant at a real price.
A pool’s weakness is that it always quotes. The formula has no view, no risk limit and no ability to decline. It will quote a price far from any external price if its reserves have been moved there, and it will quote to an arriving order regardless of what that order is about to do to the ratio. The certainty of getting a price is not the same as the price being reasonable, and the guaranteed availability is exactly what removes the safeguard a discretionary quoter provides by widening or stepping away.
This site takes no position on which design anyone should use. What is mechanically true is that one gives you a calculable cost and an unconditional counterparty, the other gives you a real counterparty and no guarantee of one, and neither removes the fact that demanding size costs more than demanding a little.