Basic Prerequisites: 01 · From Zero.
1. Intuition & Practical Objective
There are only two primitive actions in an order-driven market, and every strategy is a sequence of them. A market order says “trade now, at whatever the book offers” - it takes liquidity and pays for speed with price. A limit order says “trade only at this price or better” - it makes liquidity, is paid the spread if it executes, and in return accepts that it may never execute at all. The objective of this page is to make that trade-off exact and quantitative, because it is the first decision every desk makes.
The asymmetry is the whole story:
- The market order is certain and expensive. It executes deterministically, but the price it gets is the average of everything it consumes. A big market order “walks the book”: it fills at the best price, then the next, then the next, each one worse than the last. The extra cost over the best quote is slippage, and it grows convexly with size.
- The limit order is uncertain and cheap (if it fills). It never pays the spread - it earns it - but it only fills when someone chooses to trade against it, which is disproportionately when the price is about to move against it. A limit order that is never filled earns nothing; a limit order that is filled only in bad states loses.
The one-sentence essence. “A market order buys immediacy at a price that is convex in size; a limit order sells immediacy and is paid a spread that is exactly the compensation for the adverse selection and queue risk it accepts.”
This page focuses on the cost side (the walk). The risk side of the limit order (queue and toxicity) is developed in 04 · Matching & Priority and 05 · Failure Modes.
2. Mathematical Ground Truth & Derivations
2.1 The walk and its VWAP. Let the ask side of the book be the sequence of price levels with and cumulative sizes . A market buy of size consumes levels until . Its volume-weighted average price is
The slippage is and it is convex in : each successive level is worse, so the average price rises at an increasing rate once the order spills past the first level.
2.2 Effective spread (the realized cost). The standard microstructure cost measure (Foucault–Pagano–Röell eq. 2.3) is the effective half-spread
where is the execution price and the midquote just before the trade. For a single-tick trade at the ask, ; for an order that walks several levels, exceeds the half-spread - it flips into the realized half-spread once the price impact reverts. Price impact itself is linear in order imbalance (FPR eq. 2.8):
2.3 A limit order is a short option. Post a buy limit at . If the future mid is , your Mark-to-Market on the fill is . Unconditionally the spread is positive - - but the fill event is informative: you trade precisely when a better-informed (or faster) counterparty finds your price attractive. Writing for the probability a fill is informed and for the adverse price move,
which is negative past . The limit order’s spread is not free money; it is the premium on an option you are short. (Fully developed in Adverse Selection & Glosten–Milgrom.)
2.4 The order-type dictionary (Hasbrouck 2007, §2.1–2.2). The two primitives are refined by qualifiers, each of which is a statement about state or priority:
| Qualifier | Meaning | Effect on the book |
|---|---|---|
| TIF | time-in-force; default cancels at day end | - |
| IOC | immediate-or-cancel; never rests | pure take |
| AON | all-or-nothing | consumes a whole level or nothing |
| Hidden | on the book but invisible | loses priority to visible orders at the same price |
| Reserve / iceberg | only a slice is displayed | refreshed from reserve at the back of the queue |
Hasbrouck’s concrete illustration (IBM/Island ECN) is the canonical “walk”: bids at $112.50, $110.00, $108.00, and a $2.63 stub - a market sell of the right size consumes them in order, printing a stair-step of prices. Note also the rule variation: on Euronext an unfilled market-order remainder converts to a limit order at the execution price, whereas INET requires all orders to be priced - a venue’s mechanism, not the order, decides what happens to the stub.
3. Computational Implementation - market-order slippage is convex
A market order walks a synthetic ask ladder; we record the VWAP, the slippage over the best ask, and the cost in basis points. Standard library only.
Read the bps column: a 100-share order at the touch costs nothing over the best ask; 250 shares cost 0.2 bp; 1,000 shares cost 1.3 bp; 2,000 shares cost 3.15 bp. The cost is not linear - between 1,000 and 2,000 shares, size doubles and slippage more than doubles, because the order has spilled into the $100.05 shelf. This is why execution algorithms slice large orders (Execution Algorithms) rather than sending them whole.
The last row shows the second mechanism detail: at 2,500 shares the book only has 2,000, so the residual 500 either rests as a limit order or is rejected - a venue rule, not a market law.
4. Failure Modes & First-Principles Breakdowns
- “The quote is the price” illusion. The best quote is the price for one small order. Any size larger than the depth at the touch pays a VWAP strictly worse than . Quoting a market-order cost as the half-spread assumes the order fits inside level 1 - often false.
- Convexity kills naive sizing. Because slippage is convex, the marginal cost of the next share is increasing. Sizing on a linear cost model systematically under-forecasts cost exactly for the orders where cost matters most.
- The limit order’s hidden tax - adverse selection. A resting limit order is only filled when someone wants to trade against it, and that someone is more likely to be right than you. The spread is compensation for this, not profit; past it is a subsidy to the informed.
- Priority erodes with order type. Hidden and reserve/iceberg orders lose priority (Hasbrouck §2.1), so the displayed-then-hidden choice is a genuine trade-off between signaling and queue rank. A hidden order at the best price can fill after a visible order that arrived later.
- Venue rules change the payoff. Whether an unfilled market-order remainder rests (Euronext) or is rejected (INET-style “orders must be priced”) changes the taker’s effective risk - the same order has different mechanics on different venues. Never assume a uniform “market order” across venues.
5. References
- Hasbrouck, Empirical Market Microstructure
- Foucault, Pagano & Röell, Market Liquidity
- Harris, Larry, Trading and Exchanges (2003)
- Almgren & Chriss (2000), Optimal execution of portfolio transactions