Basic Prerequisites: none. This page assumes no prior market knowledge; arithmetic and a little patience are enough.
1. Intuition & Practical Objective
This page builds the why of the limit order book with no prior knowledge needed. The objective is one idea: a modern market is a mechanism that matches a standing list of buy commitments against a standing list of sell commitments, and the “price” you see is simply the best pair of commitments that have not yet cancelled each other out.
Start with the dumbest question: why does a market need a “book” at all? Two strangers want to trade the same stock - one wants to own it, one wants cash. If they meet by chance, they trade at a price they haggle. But millions of such wishes arrive every second, and haggling each one is impossible. So the exchange does something clever: it asks everyone to post their terms in advance and in public. “I will buy up to 300 shares at $100.00 or better.” “I will sell up to 400 shares at $100.00 or better.” These standing offers are limit orders, and the list of all un-executed ones is the limit order book.
Three steps:
-
Price is where the two lists meet. If a buyer is willing to pay $100.05 and a seller is willing to accept $100.00, a trade happens - and it happens at the older order’s price. Price is not decreed; it is the overlapping region of two sorted lists. The gap between the highest unfilled buy and the lowest unfilled sell is the spread, and it exists only because the two lists have not yet overlapped.
-
Liquidity is a set of commitments, not a number. Saying “the market is liquid” means the lists are deep (lots of size near the touch), broad (many independent participants), and resilient (the lists refill quickly after a trade). Hasbrouck (2007, §1.2) calls these depth, breadth, and resiliency - the operational definition of liquidity used throughout this pillar.
-
Someone must supply the liquidity, and that is a job with risks. A limit order waits; a market order takes. The limit-order trader has offered everyone else a free option - “hit me whenever you like” - and gets paid the spread only if that option is not exercised exactly when the price is about to move. That free-option problem is why market making is hard, and it is the seed of every failure mode in 05 · Failure Modes.
Two market designs, one book. In a quote-driven (dealer) market, a designated dealer announces the prices and everyone trades with the dealer. In an order-driven market, there is no dealer - the crowd’s own standing orders are the prices. Most modern electronic venues are order-driven, and the book is the market. (Hasbrouck 2007, Ch 2, covers both; the dealer view returns in Adverse Selection & Glosten–Milgrom.)
2. Mathematical Ground Truth & Derivations
The double auction as an optimization. Take a set of buy limit orders and sell limit orders . Define, at a candidate price ,
A uniform-price batch auction (the mechanism used for opens, closes, and intraday fixings) picks the price that maximizes executed volume,
and executes at the single price . This is the discrete ancestor of the continuous book: a continuous market is what you get when you run this auction one order at a time instead of all at once.
Why the maximum exists and is unique in volume. is non-increasing in and is non-decreasing, so is the minimum of a decreasing and an increasing function - it rises, peaks, then falls. Ties in volume are broken by convention (here: the highest price achieving the maximum, the standard tie-break that favors the side that was “right”).
The continuous limit. Let orders arrive one at a time and match immediately whenever the newest buy price reaches the newest sell price. The batch auction’s crossing condition becomes an event - a trade - and the surviving unmatched orders are the book. In the continuous limit the price is no longer a single clearing number but a path , and the book is a state that the path writes and erases (developed in 03 · The Limit Order Book).
The two sides of a trade, once and for all. Every execution has a maker (the resting limit order that supplied liquidity, matched first by priority) and a taker (the incoming aggressive order that demanded it). The taker pays the spread; the maker earns it and accepts the option value it wrote. This vocabulary is used everywhere in this pillar.
3. Computational Implementation - a batch auction clears the market
This is the most convincing way to see price formation: build a book of standing orders, evaluate every candidate price, and watch the executed volume peak where the two lists cross. Standard library only.
Read the table like an auctioneer. At $99.95 no seller accepts (supply 0), so nothing trades. As the auctioneer raises the price, buyers drop out and sellers appear. The executed volume rises to 800 at $100.05 and falls on both sides - that is the peak, and it is the equilibrium price. The 800 shares that cross all trade at the single price $100.05; everyone whose limit was inside that price gets price improvement over their own limit.
4. Failure Modes & First-Principles Breakdowns
- “The price” is not one number. At any instant there are many prices: the best bid, the best ask, the last trade, the midquote, the depth-weighted microprice. Beginners speak of “the price” and then get confused when a trade prints inside the spread or when their fill differs from the screen. The book holds a vector of prices; which one you mean depends on the question (see §2 lookup in the hub).
- A visible order is a free option you have written. When you post a limit order you commit to trade at a fixed price for an unknown later time - a short option. Nobody forces you to post; but once you do, adverse selection (being filled right before the price moves against you) is the price of the spread you hope to earn.
- The auction / continuous distinction changes the game. In a batch auction everyone trades at one price, so there is no queue-position race. Continuous trading adds priority - the maker who arrived first gets filled first - and priority turns time into a scarce, purchasable resource. This is why latency matters at all (next pages, and Queue Position & Fill Probability).
5. References
- Hasbrouck, Empirical Market Microstructure
- Foucault, Pagano & Röell, Market Liquidity
- Smith, Farmer, Gillemot & Krishnamurthy (2003), Statistical theory of the continuous double auction, Quantitative Finance 3(6)