Order Books vs AMMs: Two Ways a Market Sets a Price

Order Books vs AMMs: Two Ways a Market Sets a Price

By SimpleSwap | SimpleSwap Blog | 1 hour ago


Before you confirm a swap, you see a number. That number was produced by a machine, and in crypto there are two very different machines doing the job. This is how crypto prices are set: the order book, where people meet, and the automated market maker, where a formula decides. Understanding the difference explains most of what happens to your quote.

Ask where a price comes from and the honest answer is that somebody, somewhere, agreed to it. Everything else is plumbing.

But the plumbing matters, because the two dominant designs in crypto arrive at that agreement in completely different ways. One waits for a human on the other side. The other never needs one. They behave differently when markets get thin, fail differently under pressure, and the gap between them is often why a quote looks better on one venue than another for the exact same pair.

Here is each engine, and then what the difference does to the number you actually see.

The order book: a queue of intentions

An order book is a public list of what people are willing to do.

On one side sit the bids, offers to buy at a given price. On the other sit the asks, offers to sell. Everyone posts the price they'd accept, and the size they want, and the exchange's matching engine pairs them off whenever a bid and an ask overlap. The gap between the best bid and the best ask is the spread, and the last price at which a match occurred is displayed as "the price."

So the price on an order-book venue is not calculated. It is the residue of the most recent agreement between two parties.

Two consequences follow, and both show up in real trades.

Depth decides what a large order costs. The best ask might be for a small amount. Once your order consumes it, you move to the next-best, then the next. A big market order eats down the book, and your average fill lands worse than the quoted price. On a deep book with plenty of resting orders, that effect is negligible; on a thin one, it is brutal.

Someone has to be there. Order books need active participants, usually professional market makers who quote both sides continuously and earn the spread. When they step back, during volatility or on an unloved trading pair, the spread widens, and the book goes hollow. The market doesn't cease to exist; it just gets expensive.

This is the model behind essentially every centralized exchange, and behind a handful of on-chain venues that reproduce it.

The AMM: a formula holding two piles of coins

An automated market maker throws out the queue entirely. Instead of matching people, it holds a liquidity pool, meaning a reserve of two assets deposited by anyone who wants to contribute, and prices trades against a formula.

The classic version is the constant product rule, written as x times y equals k. The pool holds x units of one token and y units of another, and their product must remain the same after every trade. That single constraint sets the price: it is simply the ratio between the two reserves. Buy some of token X, and you remove it from the pool while adding token Y, which shifts the ratio and makes the next unit of X more expensive. The formula quotes the next price automatically, forever, without asking anyone's permission.

That produces its own two consequences.

You never wait for a counterparty. The pool is always willing to trade. At three in the morning on an obscure pair, an AMM still gives you a price, which is exactly why they became the backbone of on-chain trading.

Your trade moves the price it gets. Because you're sliding along a curve rather than filling discrete orders, a large trade against a small pool shifts the ratio significantly, and you pay for that shift yourself. This is price impact, and it is a function of your size relative to the pool's depth, which is knowable in advance rather than discovered on the way down.

One more piece completes the picture. An AMM has no idea what anything is worth in the wider world. It only knows its own reserves. What keeps its prices honest is arbitrage: when a pool drifts from the global market, traders profit by correcting it, and that profit motive drags the pool back into line. AMM pricing is therefore reactive by design. It follows the market rather than discovering it.

Order book vs AMM, side by side

8458eed54afc7fdb94bf974dd5c04bace03299764aec585a6b7e647d332c400b.png 

Framing it as order book vs AMM is a useful simplification, and like most useful simplifications it blurs in practice. Some decentralized exchanges run real order books, and some AMMs let providers concentrate liquidity into chosen price ranges to imitate order-book efficiency. But the underlying question stays binary: is your price the result of a negotiation, or the output of an equation?

What this means for the number in front of you

The reason any of this matters to a person swapping coins is that neither engine is better in general, and both are better in specific situations.

For major pairs in normal conditions, deep order books are hard to beat. Professional market makers compete to quote tight spreads on BTC and ETH, and that competition shows up as a better price for you.

For long-tail assets, AMMs frequently win by default because a pool exists for tokens that no market maker would bother to quote. The alternative to a mediocre AMM price is often no price at all.

For large trades, the deciding factor is depth rather than design. A big order into a shallow pool can cost several per cent in price impact; the same order into a thin order book walks through the levels and costs you the same way under a different name.

When markets move violently, the failure modes diverge. Books can empty as makers pull quotes. Pools keep quoting no matter what, but they quote off the pace, which is precisely the moment arbitrageurs profit at the pool's expense.

Which is why comparing venues by hand is genuinely tedious work, and why aggregation exists.

Where this fits into a swap

SimpleSwap does not run an order book or operate a pool. It sits above both, holding live connections to more than 20 liquidity providers across centralized and decentralized venues, then routing each swap to the best executable path for that specific pair and size. Sometimes that path is a market maker's book. Sometimes it is a pool. Frequently it is split.

That is the practical answer to where your quote comes from: it is the best of what both engines offered at the moment you asked, which is why the estimate lands within 99.998% of the final amount on most floating swaps.

 

"Most people will never need to know whether their price came from a book or a pool, and that's the right outcome. What they should be able to expect is that somebody asked both. The engines have genuinely different strengths, so picking one and defending it forever means handing users a worse number some fraction of the time. Our job is to ask everything available and return the best answer, not to have a favourite."

Stefan Lauer, Head of Infrastructure, SimpleSwap

 

 


https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2441475d-c8b4-4e8d-a134-2eec62bed879_200x200.png

This article was written by SimpleSwap — a self-custodial multi-source swap aggregator. 2,800+ assets, 20+ liquidity providers across CEX and DEX sources, 20M+ swaps since 2018. Wallet-to-wallet by design, with routing handled under the hood.

This article is for educational purposes only and is not financial advice. A swap moves funds between wallets you control and, once confirmed on-chain, cannot be reversed. SimpleSwap’s only official domain is simpleswap.io.

 

How do you rate this article?

6


SimpleSwap
SimpleSwap Verified Member

SimpleSwap is a self-custodial multi-source swap aggregator that helps users exchange crypto wallet-to-wallet with more privacy and control. It supports swaps across 20+ liquidity providers and 2,800+ assets, combining CEX and DEX liquidity under the hood


SimpleSwap Blog
SimpleSwap Blog

SimpleSwap is a self-custodial multi-source swap aggregator that helps users exchange crypto with more privacy and control, without comparing providers and routes themselves. It supports direct wallet-to-wallet swaps across 20+ liquidity providers and 2,800+ swappable assets, combining liquidity from well-known CEX and DEX sources under the hood.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.