Basic Prerequisites: Probability & Measure Theory and Market Microstructure & Order Types. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

Modern equity markets are fragmented: the same stock trades on a dozen+ venues at once - lit exchanges, electronic communication networks (ECNs), alternative trading systems (ATS), and dark pools. No single venue holds the whole book. A large order therefore cannot be sent “to the market”; it must be split across venues and sequenced in time. Smart order routing (SOR) is the algorithm that decides where, in what size, and in what order each child order goes.

Fragmentation creates two needs that this folder formalizes:

  1. A consolidated view. If each venue only publishes its own top-of-book, nobody sees “the” best price. The NBBO (National Best Bid and Offer) is the cross-venue best, and the consolidated tape is the merged record of trades. Both are infrastructure that SOR depends on and, when stale, that SOR is fooled by.
  2. A routing objective. The venue with the best quoted price is not always the cheapest all-in place to trade, because quotes differ in available size, in take fees / make rebates, in latency, and in the toxicity of the flow you will meet there. SOR minimizes an effective price that bundles all of these.

This folder is the routing-and-fragmentation topic of Pillar 2. It is a hub: it gives the routing-logic lookup below (job #1), then routes you to six sub-pages from zero-knowledge intuition to latency-aware and toxicity-aware routing.

The one-sentence essence. “In a fragmented market the best displayed price is neither unique nor sufficient: SOR minimizes the all-in effective price - quote + fee + latency and toxicity penalty - across venues, under the constraint that no child order may trade through a better protected quote.”

Scope note (avoid duplication). This folder is the cross-venue routing view. The order-type menu and single-book mechanics live in Market Microstructure & Order Types; single-venue child scheduling (VWAP/TWAP/POV, Almgren–Chriss) lives in Execution Algorithms and Optimal Execution; the fill-probability view of a resting order lives in Queue Position & Fill Probability. This folder cross-links them rather than repeating them.


2. Mathematical Ground Truth & Derivations

Quick-Reference Lookup (job #1) - the routing decision. For each candidate venue with top-of-book ask , shown size , take fee (signed; negative = rebate), latency (ms), and toxicity , route according to:

Input you haveRouting ruleObjective term
Best price across venuessort by ; the NBBO ask is
Available size at that pricefill at venue , then go to the next-best price
Fees (take/make)replace with the all-in
Latency (quote staleness)add expected adverse move
Toxicity (informed flow)add (VPIN-weighted)
Trade-through rulenever fill at a price worse than any protected quote elsewherehard constraint

Notation. venue best ask/bid; NBBO , ; mid ; routed size; parent size; direction .

NBBO and the consolidated tape. The NBBO is the cross-sectional extreme of venue quotes,

A consolidated tape weights each venue’s trades into one volume series; a common fragmentation index is the Herfindahl of venue volume shares, with , so the effective number of venues is .

The routing objective (the central object of this folder). Choose allocations to minimize the total all-in cost of a marketable parent order:

Because the objective is linear and separable, the optimum is the greedy water-filling solution: sort venues by ascending and fill from the cheapest. With (Brownian scaling of the adverse move over latency ), the objective automatically penalizes slow venues.

Trade-through rule. Regulation NMS Rule 611 forbids executing at a price worse than a protected quote displayed elsewhere. In routing terms it is the feasibility constraint for any venue with better protected price - i.e. you must sweep the best protected prices in order.

Fee identity and the cum-fee spread (Colliard & Foucault 2012). A maker–taker venue charges takers and pays makers a make fee (a rebate if ). Holding the total fee fixed, the cum-fee bid–ask spread (what traders actually pay) is

and it is invariant to the make/take split: moving only moves the raw spread in the opposite direction, leaving unchanged. Only a change in the total moves the all-in trading cost.


3. Computational Implementation - the hub demo

Consolidate three fragmented venues into an NBBO, then route by all-in price. Standard library only; re-executed and reproduced.

Read the numbers. The NBBO ask (100.00) sits on venue C, but C is the worst venue to take from because its 2-cent take fee swamps its 1-cent price advantage. The fee-aware router buys 400 on B and only 100 on C (all-in 100.0120); the price-only router grabs C first and overpays 0.20 bps. Small here - but this is the exact reordering that the sub-pages scale up to full routing engines.


4. Failure Modes & First-Principles Breakdowns

Hub signposts - the full analysis is in 05 · Failure Modes & Practice. In one line each:

  1. Stale NBBO / trade-through - routing on a snapshot whose quotes have already moved makes the router execute at a worse price than a protected quote still displayed elsewhere - a Reg NMS violation and a real cost.
  2. Latency arbitrage - a slow router’s quotes are free options to faster traders; the pick-off loss scales like , so a venue that looks cheapest can be the most expensive once latency is priced.
  3. Fee-driven misrouting - optimizing the raw quote instead of the all-in (quote + fee) price systematically sends flow to the venue that displays best but charges most.

5. References

  • Hasbrouck, Joel - Empirical Market Microstructure (2007)
  • O’Hara, Maureen & Ye, Mao - “Is market fragmentation harming market quality?” JFE 100(3), 459–474 (2011).
  • Colliard, Jean-Edouard & Foucault, Thierry - “Trading fees and efficiency in limit order markets,” RFS 25(11), 3389–3421 (2012).
  • Biais, Bruno; Glosten, Lawrence & Spatt, Chester - “Market microstructure: A survey of microfoundations, empirical results, and policy implications,” JFM 8(2), 217–264 (2005).
  • Foucault, Pagano & Röell - Market Liquidity (2013)

6. Connected Graph Bridges

Beginner: start at 01 · Practitioner: start at 05