Level 4 · Money and marketsThe gold rush#311

Order books vs AMMs: a queue of people or a formula with two sacks

An order book matches buyers with sellers who have named their own prices. An automated market maker (AMM) has no sellers waiting: a smart contract holds two tokens and prices every swap with a formula. Both charge you more the bigger your order is, for different reasons.

Picture two ways to sell gold dust in a boomtown. At the trading post, buyers pin notes to a board: "I'll pay this much for an ounce." The clerk hands your dust to the best note on the board.

At the edge of town stands a machine with two sacks, one of dust, one of coins. There are no notes and no clerk. You pour dust in, and the machine works out your coins from what's left in its sacks.

The first is an order book. The second is an automated market maker, or AMM. One waits for people to name prices. The other does sums.

What it is

An order book is a list of open offers from real traders. Buy offers are called bids, sell offers are called asks. A trade happens when an incoming order meets one already waiting. "Order books explained" walks through the queue in detail.

An AMM is a smart contract that holds reserves of two tokens. It has no list of offers. It sets the price from the ratio of its reserves, using a fixed formula. "Automated market makers explained" covers the formula step by step.

Most centralised exchanges run order books. Most decentralised exchanges run AMMs. The difference decides who sets the price, who holds your coins and who answers to the sheriff.

How it works

Two clearly made-up examples, same coin, same starting price of 2,000 dollars per ether. You want to buy 5 ether.

On the order book. The asks waiting at the top of the book:

  • 2 ether at 2,001 dollars
  • 2 ether at 2,003 dollars
  • 3 ether at 2,008 dollars

Your market order takes the first two lines and one ether from the third. That's 4,002 plus 4,006 plus 2,008, a total of 10,016 dollars, or 2,003.20 per ether before the exchange's fee. You paid the prices other people chose. Coinbase's documentation states the rule: "Orders are matched against existing order book orders at the price of the order on the book" (Coinbase).

On the AMM. A pool holds 500 ether and 1,000,000 dollar stablecoins. Its price is 1,000,000 divided by 500, so 2,000 dollars. The Uniswap v2 whitepaper describes the rule as "the invariant that the product of the reserves cannot decrease" (Uniswap v2). Here that product is 500 × 1,000,000 = 500,000,000.

  1. After your trade the pool keeps 495 ether. To keep the product, its stablecoin side must reach 500,000,000 ÷ 495 = 1,010,101.01.
  2. So 10,101.01 stablecoins must count towards the formula.
  3. The whitepaper says "Traders pay a 30-basis-point fee on trades", so only 99.7% of what you pay counts. You pay 10,101.01 ÷ 0.997 = 10,131.40 stablecoins.
  4. That's 2,026.28 per ether, fee included. The pool's price is now 1,010,131.40 ÷ 495, about 2,040.67 dollars.

Same order, two bills: 2,003.20 on this order book before fees, 2,026.28 in this pool with its fee. Neither number says which kind of market is cheaper in general. They show where the cost comes from. On the book, you pay for the gaps between other people's offers. In the pool, you pay a fee and you shift the ratio of the sacks yourself.

Who brings the pool back? Nobody inside it. The whitepaper relies on outsiders: "Since arbitrageurs will trade with Uniswap if this price is incorrect", the pool's price "tends to track the relative market price". An AMM borrows its price from the order books around it, one arbitrage trade at a time.

Why it matters

Who sets the price. On an order book, traders do, with every limit order. In an AMM, the formula does, and arbitrage traders keep it honest for a profit.

Who provides the coins. On an order book, other traders and professional market makers. In an AMM, people who deposit both tokens into the pool and earn the fees. "Liquidity pools explained" covers what they risk.

Who holds your money. A centralised exchange holds your coins while you trade. An AMM swaps straight from your own wallet, and the smart contract is the only counterparty.

Who the sheriff watches. In the EU, MiCA requires operators of crypto trading platforms to "make public any bid and ask prices and the depth of trading interests at those prices", and bars them from dealing "on own account" on their own platform (MiCA Article 76, via ESMA). Recital 22 of the same regulation leaves out services provided "in a fully decentralised manner without any intermediary" (EUR-Lex). The trading post needs a licence. The machine at the edge of town may have nobody who could hold one.

Where people get it wrong

  • "An AMM has no price impact because there's no order book." The formula is the price impact. The bigger your trade compared with the pool, the worse your price.
  • "Order books are fair, AMMs are rigged." Both follow published rules. Both get expensive when little is waiting, or little is in the pool.
  • "A DEX is just a cheaper exchange." Different costs: network fees, the pool fee and price impact instead of a trading fee and the spread.
  • "The AMM price is the market price." It's the pool's price. It only matches the wider market once arbitrage traders have done their job.

Check what's behind the price

Before any trade, look at what stands behind the quoted price. On an order book, open the depth view. On an AMM, read the "price impact" line and the size of the pool.

The board shows you the queue. The machine shows you its sacks. Neither shows you a free lunch.

Frequently asked questions

What is the difference between an order book and an AMM?

An order book matches your order with offers that other traders have placed at prices they chose. An automated market maker has no offers waiting: a smart contract holds two tokens and calculates the price of each swap from the ratio of its reserves.

Which is cheaper, an order book or an AMM?

It depends on the market and the size of the trade. On an order book you pay the exchange fee and the gaps between offers. On an AMM you pay the pool fee, the network fee and the price impact of your own trade.

How does an AMM know the right price?

It doesn't. The pool's price comes only from its own reserves. Arbitrage traders buy from the pool when it's cheaper than other markets and sell into it when it's dearer, which pulls its price towards the wider market.

Do centralised exchanges use AMMs?

Centralised exchanges mostly run order books, where customers' buy and sell orders are matched by the exchange's matching engine. AMMs are mostly found on decentralised exchanges, running as smart contracts on a blockchain.

Are AMMs regulated under MiCA?

MiCA sets rules for firms that operate crypto trading platforms, including publishing bid and ask prices and depth. Its recital 22 says services provided in a fully decentralised manner without any intermediary fall outside its scope. Where a company stands between the user and the contract, the answer can differ.

Sources

  1. Coinbase Developer Platform, Exchange matching engine (read on 19 November 2026)
  2. Hayden Adams, Noah Zinsmeister, Dan Robinson, Uniswap v2 Core (whitepaper, March 2020)
  3. ESMA, Interactive single rulebook, MiCA Article 76: operation of a trading platform for crypto-assets
  4. EUR-Lex, Regulation (EU) 2023/1114 on markets in crypto-assets (MiCA)

Read next.