Basic Prerequisites: 03 - SOR Logic and 05 - Failure Modes & Practice.
1. Intuition & Practical Objective
The greedy SOR of page 03 minimizes - price plus fee. Production routers minimize a richer effective price that also prices the two risks the basic objective ignores: latency (the quote may move before you arrive) and toxicity (the counterparty on the other side may be informed). This page builds the full objective, solves it, and shows how latency alone flips the optimal venue.
The advanced objective replaces the naive per-share cost with
where is the venue’s latency in ms, the per- price diffusion, the venue’s toxic-flow measure (e.g. VPIN or a realized-spread proxy), and a risk aversion. Three consequences follow:
- A cheaper quote can be a worse route. If a venue’s price advantage is smaller than its penalty, the router must skip it - routing away from the toxic or too-slow quote.
- There is a crossover latency. For any two venues there exists an below which the better-quoted venue wins and above which the faster venue does; the router should know it.
- Toxicity is venue-specific and time-varying. Lit venues, inverted venues, and dark pools carry different ; SOR blends price, fee, latency, and toxicity dynamically.
The one-sentence essence. “A production SOR minimizes quote + fee + + toxicity, so it will deliberately route away from the venue displaying the best price when that venue is too slow or too toxic to be worth it.”
2. Mathematical Ground Truth & Derivations
The latency-aware objective.
a linear program solved by the same greedy merge as page 03, but now on the latency-adjusted effective price. The term is the expected adverse move over ms (Brownian scaling from pages 05–06).
Crossover latency. Venue (better quote) vs venue (faster). Equal effective price when
so if ‘s quoted advantage is (per share, worse), venue is preferable for any . Below the crossover the fast venue wins even though its quote is worse.
Toxicity term. Let be a venue’s flow-toxicity (probability the counterparty is informed). The cost of taking liquidity is the expected adverse move conditional on trading against informed flow, ; a common one-parameter reduction is with the conditional adverse move. VPIN and realized-spread are the standard empirical estimates (Toxic Order Flow & VPIN).
Limit vs market: the fill-probability term. A maker route replaces with (a rebate) but multiplies the gain by the fill probability :
so rebate-chasing requires to justify it - the link to Queue Position & Fill Probability.
Cointegration/uniqueness underpinning. The objective is well-posed because venue prices are cointegrated to one efficient price (Hasbrouck Ch 10); the cross-venue basis is stationary, so the “best” venue is a well-defined, estimable quantity rather than an artifact.
3. Computational Implementation - latency-aware routing
Show that adding flips the optimal venue, and compute the crossover latency. Standard library only; re-executed and reproduced.
Read the numbers. Venue B has the best raw quote (100.000) and a zero fee - a price-only router sends the whole order there. But B is 8 ms slow, and makes its true all-in cost 100.05657, far worse than A’s 100.00947. The latency-aware SOR routes 600 to A and 400 to C for a true cost of 100.01126 - saving $45.31 per 1,000 shares over the naive choice. And the crossover is brutal: B would only deserve the order if its latency fell below 0.2243 ms, i.e. below every microsecond-tier venue’s realistic floor. The “cheapest” quote was the most expensive route.
4. Failure Modes & First-Principles Breakdowns
- Price-plus-fee is not enough. Any router without will systematically prefer slow venues whose displayed edge is illusory - the single largest structural deficiency of a naive SOR.
- Toxicity is hidden. is not in the quote; a venue can display a tight spread and still be where the informed flow goes. Without a toxicity term the router is a magnet for adverse selection (VPIN).
- Rebate-chasing without fill probability. The maker-rebate term can be negative in expectation once missed fills and adverse selection are counted; posting for the rebate is a trade, not free money.
- Static objective in a moving market. , , and change intraday (news, volatility regimes). A router with fixed parameters is mis-optimized exactly when it matters most; the objective must be re-estimated on rolling windows.
5. References
- Hasbrouck, Joel - Empirical Market Microstructure (2007)
- Easley, López de Prado & O’Hara - “Flow toxicity and liquidity in a high-frequency world,” RFS 25(5), 2012 (VPIN); and “The microstructure of the flash crash,” JPM, 2011.
- Biais, Foucault & Moinas - “Equilibrium fast trading,” JFE 116(2), 2015. The economics of the latency term.
- Colliard & Foucault - “Trading fees and efficiency in limit order markets,” RFS 25(11), 2012, and Foucault, Pagano & Röell - Market Liquidity (2013)
6. Connected Graph Bridges
- Back: 05 · Failure Modes & Practice · Index Hub
- Toxicity: Toxic Order Flow & VPIN · Adverse Selection & Glosten–Milgrom
- Fill probability & maker routes: Queue Position & Fill Probability
- Latency & hardware: Low-Latency Systems Architecture · Hardware Acceleration & FPGA
- Scheduling the children: Execution Algorithms: VWAP, TWAP, POV