Skip to content
homeaboutworkprojectsthesiswritingresume
Loading
~/blog/the-limit-order-book0%dark
  1. home/
  2. writing/
  3. The Limit Order Book

27 May 2026 · 18 min read · updated 13 June 2026

The Limit Order Book

The limit order book is the data structure a modern exchange uses to record resting trading intentions and to match them. This chapter is about the mechanism itself with no stochastic modelling. We cover the anatomy of an order, the price grid, the full taxonomy of order types and times in force, the price-time priority rule and how priority is gained and lost, pro-rata allocation, the matching loop and the trade, locked and crossed books, the opening and closing auctions, hidden and pegged liquidity, and the reading of the message stream, with worked examples at each step.

  • 1 connection
  • market-microstructure
  • limit-order-book
  • trading
On this page▾
  • Bids and asks
  • The price grid
  • The touch
  • Order types by execution instruction
  • Order types by display
  • Time in force
  • Price-time priority
  • Pro-rata and hybrid priority
  • Matching and the trade
  • Crossed and locked books, and the cross
  • Hidden liquidity and dark venues
  • Modification, cancellation, and the message stream
  • Making, taking, adverse selection, and fees
  • Tick size in practice
  • What the mechanism determines

18 min left

  • Bids and asks1m
  • The price grid1m
  • The touch1m
  • Order types by execution instruction2m
  • Order types by display1m
  • Time in force1m
  • Price-time priority2m
  • Pro-rata and hybrid priority1m
  • Matching and the trade1m
  • Crossed and locked books, and the cross3m
  • Hidden liquidity and dark venues1m
  • Modification, cancellation, and the message stream1m
  • Making, taking, adverse selection, and fees1m
  • Tick size in practice1m
  • What the mechanism determines1m

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.

FieldMeaning
SideBuy (bid) or sell (ask)
PriceLimit bound, or none for a market order
SizeQuantity, in lots or shares
Time in forceHow long the order lives
DisplayHow much size is visible
InstructionsPeg, post-only, stop trigger, and similar
IdentityOrder 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.

PriceBid sizeAsk size
100.03700
100.02500
100.01200
100.00300
99.99800
99.98400

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 BBB is the highest price with resting buy orders, the best ask AAA the lowest price with resting sell orders, and B<AB<AB<A in an orderly market. Their difference is the spread s=A−Bs=A-Bs=A−B, their average is the mid M=12(A+B)M=\tfrac{1}{2}(A+B)M=21​(A+B), and the depth resting exactly at the touch is the size available to trade before the price moves. The imbalance is I=QBQB+QAI=\frac{Q_B}{Q_B+Q_A}I=QB​+QA​QB​​, where QBQ_BQB​ and QAQ_AQA​ 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 I=300/(300+200)=0.6I=300/(300+200)=0.6I=300/(300+200)=0.6, a bid-heavy touch.

#Order types by execution instruction

The execution instruction states how an order interacts with the resting book.

TypeRestsTakes on arrivalPrice controlCore use
LimitYes, if not marketableYes, if marketableStrict boundProvide or take at a price
MarketNoYes, all of itNoneImmediacy at any price
Marketable limitRemainder restsYes, to the boundCappedTake now, cap the slippage
StopAfter triggerAfter triggerNone until activeExit or breakout on a move
Stop-limitAfter triggerAfter triggerBound after triggerTrigger with gap protection
PeggedYes, repricedOptionalRelative to a referenceTrack the touch passively
Post-onlyYesNeverBound, reprices if crossingGuarantee the maker side

A limit order carries a price bound and will trade only at that price or better. A buy limit at ppp executes at any price at or below ppp 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.

DisplayShownPriority at its priceLeakage
DisplayedFull sizeStrongestHigh
IcebergA small peakPeak displayed, reserve refills to the backMedium
HiddenNothingYields to displayed ordersLow
Midpoint or darkNothingMatches at the mid onlyLowest

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 10,00010{,}00010,000 rests at 50.0050.0050.00 with a displayed peak of 1,0001{,}0001,000 and 500500500 already ahead of it in the queue, and a series of market sells arrives.

EventMarket sellDisplayed at 50.00Hidden leftIceberg fill
Start150090000
1500100090000
21000100080001000
360040080001600
4400100070002000

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 9,0009{,}0009,000 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.

TIFLives untilPartial fillTypical use
DayEnd of sessionAllowedStandard resting order
GTCCancelled or venue maximumAllowedLong-standing quote
GTD or GTTA stated date or timeAllowedBounded resting order
IOCImmediately, cancel remainderAllowedAlgorithmic taking
FOKImmediately, all or noneNot allowedAtomic block take
At-the-open or closeThe auction onlyAllowedAuction 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 orderArrivalSize beforeFilledSize after
Firstt1550
Secondt2312
Thirdt3808

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.

ActionEffect on priority
New orderJoins the back of its price queue
Change priceForfeits priority, treated as new at the new price
Reduce sizeRetains place in the queue
Increase sizeAdded quantity goes to the back, often the whole order
CancelRemoved, 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.

RuleRewardsCommon venue
Price-timeArriving earlyEquities, most futures
Pure pro-rataPosting largeShort-rate futures
Top-of-book plus pro-rataFirst in, then sizeMany options and futures
Time-pro-rataSize weighted by ageSome 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.

StepPrice hitAvailableTakenRemaining order
1100.01200200400
2100.025004000

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 (200⋅100.01+400⋅100.02)/600=100.0167(200\cdot 100.01+400\cdot 100.02)/600=100.0167(200⋅100.01+400⋅100.02)/600=100.0167, 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, B<AB<AB<A. A locked book has B=AB=AB=A and a crossed book has B>AB>AB>A, 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.

PriceCumulative buyCumulative sellMatchable
100.02300900300
100.01600600600
100.001000300300

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.

SnapshotIndicative priceMatchedImbalance
Window open100.00200600 buy
Midway100.01450250 buy
Before the cross100.016000

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.

MessageEffect
NewInserts an order and acknowledges it
CancelRemoves a resting order
Cancel-replaceChanges fields, keeping or resetting priority by the rules above
FillReports a full or partial execution
RejectDeclines an order that violates a rule

The exchange exposes this activity at three depths.

FeedShowsUse
Level 1Best bid and ask and their sizesQuote and last sale
Level 2Aggregate depth at each priceLiquidity at a glance
Level 3Every message with order identitiesFull 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.

RoleMaker-taker venueInverted venue
MakerEarns a rebatePays a fee
TakerPays a feeEarns a rebate
Venue keepsFee minus rebateFee minus rebate

On a one-tick market of width 0.010.010.01 with a taker fee of 0.00300.00300.0030 and a maker rebate of 0.00250.00250.0025 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.

GroupQuoting tickTrading constraint
ControlOne centNone
G1Five centsQuote in the wider tick only
G2Five centsQuote and trade in the wider tick
G3Five centsPlus 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.

Part 1 of 2 in Market Microstructure

next →Price Formation in the Order Book

Explore connections

see in the atlas →

related

  • Price Formation in the Order Book
cite
@misc{the-limit-order-book,
  author = {Zac Kienzle},
  title  = {The Limit Order Book},
  year   = {2026},
  month  = {05},
  url    = {https://zackienzle.com/blog/the-limit-order-book}
}