A limit order book is a ledger of intentions. Every participant who wants to buy or sell but is not willing to trade at the current price posts a resting order stating a price, a size, and a side, and the exchange records it. The book is the collection of all such resting orders, sorted by price, a live list of who will trade what, where, and in what order. Price is not an input to this object. Price is what comes out of it when a willing buyer and a willing seller meet, so to understand price formation one first has to understand the book as a mechanism.
#Bids and asks
Every resting order sits on one of two sides. A bid is a standing offer to buy, specifying a price a trader will pay and a size they will take at it. An ask, or offer, is a standing offer to sell. A bid is liquidity for an incoming seller and an ask is liquidity for an incoming buyer, so the two sides are mirror images and everything said about one holds for the other with the inequality reversed.
A single order is a small record carrying the fields below, and the exchange timestamps it on receipt, assigns it a sequence number, and acknowledges it.
| Field | Meaning |
|---|---|
| Side | Buy (bid) or sell (ask) |
| Price | Limit bound, or none for a market order |
| Size | Quantity, in lots or shares |
| Time in force | How long the order lives |
| Display | How much size is visible |
| Instructions | Peg, post-only, stop trigger, and similar |
| Identity | Order id, used by every later message |
From the moment of acknowledgement the order has a definite position in the book and a definite priority, and every later event that touches it, a partial fill, a modification, a cancellation, references it by its identity. The order is the atomic unit; the rest of the chapter shows how orders combine.
#The price grid
Prices are not continuous. An exchange fixes a smallest increment, the tick, and every order price is a multiple of it. The book is therefore an array indexed by tick price, and at each price sits a queue of the resting orders at that price. Bid prices occupy the lower part of the array and ask prices the upper part, and a price holds orders on at most one side at any instant, because a resting buy at a price at or above a resting sell would already have traded.
Tick size is a policy lever, not a detail. A large tick relative to the asset's value pins the spread at one tick, so price stops differentiating orders and the queue becomes the only thing that does, which raises the value of time priority and pushes volume into the auction and into hidden venues. A small tick lets makers undercut each other by a negligible amount, which narrows spreads but thins each price level and rewards speed. Many venues run tiered tick regimes that coarsen the grid for high-priced or illiquid names.
The size resting at a price is its depth, and the book as a whole is the function from price to depth on each side. A snapshot is read as a two-column ladder, asks above and bids below, with the touch in the middle.
| Price | Bid size | Ask size |
|---|---|---|
| 100.03 | 700 | |
| 100.02 | 500 | |
| 100.01 | 200 | |
| 100.00 | 300 | |
| 99.99 | 800 | |
| 99.98 | 400 |
Here the best ask is 100.01 with 200 resting, the best bid is 100.00 with 300 resting, the spread is one tick, and the ask side is thinner at the touch, so a buyer pays up faster than a seller does. This ladder is the instantaneous supply and demand schedule of the asset, drawn from real orders that will actually execute.
#The touch
The two innermost populated prices are the touch. The best bid is the highest price with resting buy orders, the best ask the lowest price with resting sell orders, and in an orderly market. Their difference is the spread , their average is the mid , and the depth resting exactly at the touch is the size available to trade before the price moves. The imbalance is , where and are the best-bid and best-ask sizes. It is the bid share of touch depth and measures which side is heavier. In the ladder above , a bid-heavy touch.
#Order types by execution instruction
The execution instruction states how an order interacts with the resting book.
| Type | Rests | Takes on arrival | Price control | Core use |
|---|---|---|---|---|
| Limit | Yes, if not marketable | Yes, if marketable | Strict bound | Provide or take at a price |
| Market | No | Yes, all of it | None | Immediacy at any price |
| Marketable limit | Remainder rests | Yes, to the bound | Capped | Take now, cap the slippage |
| Stop | After trigger | After trigger | None until active | Exit or breakout on a move |
| Stop-limit | After trigger | After trigger | Bound after trigger | Trigger with gap protection |
| Pegged | Yes, repriced | Optional | Relative to a reference | Track the touch passively |
| Post-only | Yes | Never | Bound, reprices if crossing | Guarantee the maker side |
A limit order carries a price bound and will trade only at that price or better. A buy limit at executes at any price at or below and never above. If its price is worse than the opposite touch it rests and supplies liquidity. If its price reaches or crosses the opposite touch it is marketable and executes immediately against resting depth, resting any unfilled remainder at its limit price. All displayed liquidity comes from limit orders.
A market order carries no price and demands immediate execution. It consumes resting liquidity on the opposite side, taking the front of the best queue and walking outward through worse prices until filled. Because it surrenders price control, a market order in a thin book can fill far from the touch, which is why most venues bound it with a protection limit.
A stop order is dormant until a trigger price trades, then activates into a market order; a stop-limit activates into a limit order, trading certainty for gap protection. Stops are invisible before they trigger, so a cluster of stops is hidden fuel that accelerates a move once the trigger cascade begins. As a worked case, a sell stop at 99.95 on the ladder above is inert while the bid holds at 100.00, but a market sell that walks the bid down to 99.95 trips it, adding a fresh market sell that walks the book further, the mechanism behind stop cascades.
A pegged order tracks a reference and reprices as the reference moves. A primary peg sits at the same-side touch, a market peg at the opposite touch, and a midpoint peg at the mid, each optionally offset. A midpoint peg trades only inside the spread and underlies much hidden liquidity. A post-only order refuses to take, repricing to rest or rejecting if it would cross, which guarantees the trader the maker side and the maker rebate and prevents accidental locking of the market.
#Order types by display
Display governs how much of an order the market can see, and it trades queue priority against information leakage.
| Display | Shown | Priority at its price | Leakage |
|---|---|---|---|
| Displayed | Full size | Strongest | High |
| Iceberg | A small peak | Peak displayed, reserve refills to the back | Medium |
| Hidden | Nothing | Yields to displayed orders | Low |
| Midpoint or dark | Nothing | Matches at the mid only | Lowest |
A fully displayed order shows its entire size, earning the strongest priority at its price. A hidden order shows nothing and on most venues yields priority to every displayed order at its price, so a displayed order behind it in time still trades first. An iceberg, or reserve order, displays a small peak and hides the remainder, and when the peak is consumed the order refills the display from the reserve with the refilled tranche joining the back of the queue, so the hidden size repeatedly surrenders time priority as it replenishes. The trade-off is explicit, visibility buys queue priority and costs information leakage.
A worked refill sequence makes the mechanism concrete. An iceberg buy for a total of rests at with a displayed peak of and already ahead of it in the queue, and a series of market sells arrives.
| Event | Market sell | Displayed at 50.00 | Hidden left | Iceberg fill |
|---|---|---|---|---|
| Start | 1500 | 9000 | 0 | |
| 1 | 500 | 1000 | 9000 | 0 |
| 2 | 1000 | 1000 | 8000 | 1000 |
| 3 | 600 | 400 | 8000 | 1600 |
| 4 | 400 | 1000 | 7000 | 2000 |
Event 1 clears the 500 ahead. Event 2 fills the iceberg's displayed peak of 1000 and triggers a refill of a fresh 1000 from the reserve, which joins the back of the queue, and events 3 and 4 chew into that peak and refill again. The depth feed never shows more than a 1000 peak even while rests hidden, so a counterparty reading the book sees a fraction of the true size. Display is not size.
#Time in force
The time in force states how long an order lives.
| TIF | Lives until | Partial fill | Typical use |
|---|---|---|---|
| Day | End of session | Allowed | Standard resting order |
| GTC | Cancelled or venue maximum | Allowed | Long-standing quote |
| GTD or GTT | A stated date or time | Allowed | Bounded resting order |
| IOC | Immediately, cancel remainder | Allowed | Algorithmic taking |
| FOK | Immediately, all or none | Not allowed | Atomic block take |
| At-the-open or close | The auction only | Allowed | Auction participation |
A day order expires at the end of the session, while good-till-cancelled persists across sessions and good-till-date expires at a horizon. An immediate-or-cancel order executes against what is available on arrival and cancels the remainder rather than resting, and a fill-or-kill order is stricter, executing in full immediately or not at all. Both are taker instructions for a trader who wants liquidity now and refuses a resting footprint, and they are the workhorses of execution algorithms that slice a parent order into many child IOCs. At-the-open and at-the-close orders participate only in the auction.
#Price-time priority
When several orders rest at the same price the exchange must decide which trades first, and the dominant rule is price-time priority, a total order. Across prices the more aggressive order has precedence, the higher bid and the lower ask. Within a price the queue is first in, first out, so an order's rank is fixed by the time it arrived and improves only as the orders ahead of it leave.
As a worked example, let the best bid at 100.00 hold three orders in arrival order, and send a market sell of 6 lots.
| Queue order | Arrival | Size before | Filled | Size after |
|---|---|---|---|---|
| First | t1 | 5 | 5 | 0 |
| Second | t2 | 3 | 1 | 2 |
| Third | t3 | 8 | 0 | 8 |
The market sell of 6 fills the first order in full and the second in part, leaving 2 of the second and all of the third resting, and the next-best bid at 99.99 is untouched because the better price trades first. Time priority is what makes the earliest order the first to fill.
Priority is acquired on arrival and is fragile. The table below states the effect of each action.
| Action | Effect on priority |
|---|---|
| New order | Joins the back of its price queue |
| Change price | Forfeits priority, treated as new at the new price |
| Reduce size | Retains place in the queue |
| Increase size | Added quantity goes to the back, often the whole order |
| Cancel | Removed, those behind advance |
Changing price forfeits priority because at the new price the order is a newcomer, which is why chasing the market is expensive in queue terms. Because the front of the queue fills first and fills are adversely selected, arriving early is a real and decaying asset, one reason low latency has value to a passive trader.
The race for priority runs both ways. When new information arrives the touch is about to move, and a maker who reads it wants to cancel a now-stale quote before an incoming order picks it off. Take two makers resting at the same bid, one fast and one slow, when a signal says value has fallen below the bid. The fast maker cancels in microseconds and avoids the fill; the slow maker is still resting when the informed sell arrives and is executed at a price the market has already left, taking the adverse loss. Speed therefore buys two distinct things, a better place in line when joining the queue and the ability to leave before a stale quote is hit. Both are why venues sell co-location and why some add a deliberate speed bump, a few hundred microseconds of delay, to blunt the fastest takers and protect resting liquidity.
#Pro-rata and hybrid priority
Not every venue uses time priority. A market with a coarse tick, where many orders pile at the same price, often allocates an incoming order pro-rata, splitting it across all resting orders at the best price in proportion to size.
| Rule | Rewards | Common venue |
|---|---|---|
| Price-time | Arriving early | Equities, most futures |
| Pure pro-rata | Posting large | Short-rate futures |
| Top-of-book plus pro-rata | First in, then size | Many options and futures |
| Time-pro-rata | Size weighted by age | Some futures |
Pure pro-rata removes the reward for arriving early and rewards posting large, which inflates displayed size as traders compete for allocation. As a worked case, suppose three orders of 100, 200, and 700 lots rest at the best price under pure pro-rata and a market order of 50 arrives. It fills them in the ratio 1 : 2 : 7, so the orders receive 5, 10, and 35 lots, independent of who arrived first. The allocation rule is the main structural choice an exchange makes about how liquidity is rewarded, and it changes the optimal order size and the value of speed.
#Matching and the trade
An incoming marketable order is the aggressor, the resting orders it executes against are resters, the aggressor is the taker of liquidity, and the rester is the maker. The distinction drives the fee schedule, since most venues charge the taker and rebate the maker.
The matching engine runs a loop. It takes the best contra price, fills the aggressor against the front of that queue, advances by priority, and when a price level is exhausted it moves to the next price and continues, walking the book, until the aggressor is filled, reaches its limit price, or exhausts the book. Take the opening ladder and send a market buy of 600.
| Step | Price hit | Available | Taken | Remaining order |
|---|---|---|---|---|
| 1 | 100.01 | 200 | 200 | 400 |
| 2 | 100.02 | 500 | 400 | 0 |
The buy takes all 200 at 100.01 and 400 of the 500 at 100.02, prints two trades, and lifts the best ask to 100.02 with 100 left. Its average price is , worse than the 100.01 touch it started against, and the gap is the immediate impact of taking size. A resting order larger than the aggressor keeps its place with the leftover, an aggressor larger than the resting size continues onward, and a marketable limit halts at its bound and rests the remainder. The last print is the asset's reported last sale.
#Crossed and locked books, and the cross
In continuous trading the book should be uncrossed, . A locked book has and a crossed book has , both anomalies that arise transiently across venues or on an aggressive arrival and that a healthy engine resolves instantly by executing the overlap, the incoming order crossing the spread against the resting contra side. Regulation forbids displaying a locked or crossed national quote, which is why post-only and repricing logic reprice an order that would otherwise lock rather than letting it sit.
A related rule binds across venues. A trade-through is an execution at a price worse than a protected quote displayed somewhere else, a better price ignored, and order-protection regulation forbids it. A marketable order must respect the best displayed price wherever it sits, so a trader who wants to take size across several venues at once sends intermarket sweep orders, marketable orders each flagged to take one specific protected quote while the simultaneous siblings take the others, clearing the whole overlap without trading through any of them. The exceptions are narrow, a flickering quote, a self-help declaration against an unresponsive venue, and sub-tick prices, and the rule is the reason a single logical order often fragments into one child per venue.
The other sense of the cross is the auction, or uncross, that opens and closes the session. Through an accumulation window, on-open or on-close orders and eligible continuous orders collect without trading, and at the auction time the exchange computes the single clearing price that maximises executable volume, breaking ties by minimising the residual imbalance and then by proximity to a reference price. Every crossing order trades at this one price regardless of its own limit. As a worked example, suppose the accumulated auction interest is the following.
| Price | Cumulative buy | Cumulative sell | Matchable |
|---|---|---|---|
| 100.02 | 300 | 900 | 300 |
| 100.01 | 600 | 600 | 600 |
| 100.00 | 1000 | 300 | 300 |
Matchable volume is the lesser of cumulative buy and sell interest at each price, and it is maximised at 100.01 where 600 can cross, so the auction prints 600 shares at the single price 100.01. A buyer with a 100.02 limit and a seller with a 100.00 limit both trade at 100.01 and receive price improvement against their bounds, and within the auction priority still runs by price then time with market orders ahead of limit orders. The opening auction discovers the price after the overnight gap and the closing auction sets the official close that benchmarks index funds, which is why closing-auction volume dominates the day.
A separate safeguard, self-match prevention, stops a firm's own bid from executing against its own ask by cancelling the older order, the newer order, or both, so internal orders pass through without a wash trade.
Through the accumulation window the exchange does not keep the developing auction secret. It disseminates the indicative clearing price, the volume that would cross at it, and the imbalance, the side and size that would go unfilled, so traders can supply offsetting liquidity into the short side, and some venues accept imbalance-only orders that participate solely to absorb a published imbalance. As the orders accumulate the indicative figures move, and a plausible sequence is the following.
| Snapshot | Indicative price | Matched | Imbalance |
|---|---|---|---|
| Window open | 100.00 | 200 | 600 buy |
| Midway | 100.01 | 450 | 250 buy |
| Before the cross | 100.01 | 600 | 0 |
The early buy imbalance pulls the indicative price up and signals sellers to add interest, the gap closes as they do, and the final uncross prints at the price the published path advertised. This is price discovery in slow motion, the auction broadcasting its own formation so the clearing price is not a surprise.
#Hidden liquidity and dark venues
Not all liquidity is visible. Beyond hidden and iceberg orders inside a displayed book, entire venues, dark pools, accept orders that never display and match them at the prevailing midpoint of the public quote. A trader posts size into the dark, waits for a contra order, and trades at the mid with no pre-trade footprint, paying for the concealment with uncertainty of execution and the risk that the only counterparties who find the order are informed. The trade-off between display and impact runs through every choice, showing size advertises liquidity and earns queue priority but leaks intention, while hiding size protects intention but forfeits priority and slows the fill. Most institutional execution is a managed blend of displayed, hidden, and dark liquidity across many venues.
#Modification, cancellation, and the message stream
Between submission and finality an order is mutated by a stream of messages, and a venue processes far more cancels and replaces than new orders or trades, because makers continuously reprice to track the market and to manage the risk of being adversely filled.
| Message | Effect |
|---|---|
| New | Inserts an order and acknowledges it |
| Cancel | Removes a resting order |
| Cancel-replace | Changes fields, keeping or resetting priority by the rules above |
| Fill | Reports a full or partial execution |
| Reject | Declines an order that violates a rule |
The exchange exposes this activity at three depths.
| Feed | Shows | Use |
|---|---|---|
| Level 1 | Best bid and ask and their sizes | Quote and last sale |
| Level 2 | Aggregate depth at each price | Liquidity at a glance |
| Level 3 | Every message with order identities | Full book reconstruction |
From the Level 3 feed the entire book is reconstructed event by event, each order placed in its queue, each cancel and fill applied, so the queue position of any order at any instant is recoverable. Reconstruction from Level 3 is the foundation of every empirical study of the book and of every model that conditions on queue position, since it is the only data that reveals where in line an order actually stood.
#Making, taking, adverse selection, and fees
Two roles meet in the book. A maker posts passive limit orders and waits, and a taker crosses the spread with a marketable order. The maker supplies the option to trade now and the taker exercises it, so the spread is the price of immediacy the taker pays and the maker earns.
The maker's earning is not free. A resting order grants the rest of the market a free option, and it executes precisely when the arriving counterparty wanted that side, disproportionately when value has already moved against the quote, so a passive bid fills just as value sinks below it. This systematic loss to better-informed flow is adverse selection, and it is the reason a spread exists even with no processing cost and no inventory risk. It is the central quantity the companion chapter prices, and it is why a maker reprices constantly and races to cancel a stale quote before it is picked off.
Fees sharpen the economics. Most venues run a maker-taker schedule, charging the taker a fee per share and paying the maker a rebate to attract resting depth, while inverted venues do the reverse.
| Role | Maker-taker venue | Inverted venue |
|---|---|---|
| Maker | Earns a rebate | Pays a fee |
| Taker | Pays a fee | Earns a rebate |
| Venue keeps | Fee minus rebate | Fee minus rebate |
On a one-tick market of width with a taker fee of and a maker rebate of per share, the taker's true cost of crossing is the half-spread plus the fee and the maker's true capture is the half-spread plus the rebate minus its adverse-selection loss, so the rebate can make a one-tick market effectively sub-tick. The subsidy intensifies the queue race, since a maker paid to provide fights for a place in line that price priority alone would not justify.
#Tick size in practice
The mechanism predicts how tick size should bite. A wider tick lengthens queues and deepens the touch because makers can no longer undercut by a fraction, yet it widens the spread a taker pays and interacts with the rebate, since a fixed rebate is a larger share of a coarse tick. Whether wider ticks help or hurt liquidity is an empirical question, and the United States ran a controlled experiment, the 2016 to 2018 Tick Size Pilot, widening the tick for a sample of small-capitalisation stocks across treatment groups of increasing strictness.
| Group | Quoting tick | Trading constraint |
|---|---|---|
| Control | One cent | None |
| G1 | Five cents | Quote in the wider tick only |
| G2 | Five cents | Quote and trade in the wider tick |
| G3 | Five cents | Plus a trade-at rule |
The wider tick raised quoted spreads and displayed depth, exactly the direction the mechanism predicts, but it did not deliver the hoped improvement in liquidity or volume and shifted some volume off exchange, which is why the pilot was allowed to expire. The lesson is the honest one, the mechanism fixes the direction of the effect, depth up and spread up, while the net welfare is a measured outcome the structure alone does not settle.
#What the mechanism determines
The mechanism described here fixes the questions the rest of the subject answers. The spread, the depth profile, the priority rule, and the auction together decide how the resting price relates to the asset's fair value, how the spread compensates a maker for being adversely selected, how likely a queued order is to fill given its position, which way the next move tends to go given the imbalance, how far a large order moves the price as it walks the book, and how a trader should schedule a large order against that impact. Each is a model built on this object, and each is treated in the companion chapter on price formation. The mechanism is the order book. The models are what one does with it.