Basic Prerequisites: Econometrics & Time Series (autocovariance, MA(1), stationarity) and Probability & Measure Theory (i.i.d., conditional expectation, martingales). (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)
1. Intuition & Practical Objective
Tick-by-tick prices are not noisy copies of the same “true” price. Every trade executes at either the bid or the ask, so consecutive trades bounce between two prices that straddle the efficient price. That bounce injects a spurious negative serial correlation into observed returns - the signature of the bid-ask spread - even when the efficient price itself is a random walk with no predictability at all.
This folder is the measurement hub for Pillar 6. Its job is the market maker’s accounting problem: how much does it cost to trade, and where does the spread revenue go? It (a) defines the three spread measures (quoted, effective, realized) that every execution desk computes, (b) delivers the Roll (1984) estimator - the single most famous microstructure formula, which recovers the spread from just the autocovariance of returns, and (c) decomposes the spread into its economic components (order processing, inventory holding, adverse selection) following Glosten–Harris, Stoll, and Huang–Stoll.
The one-sentence essence. “Trade prices bounce between bid and ask, so the first-order autocovariance of returns is negative; the effective spread is , and the realized spread is what the liquidity provider keeps after the informed flow has moved the price.”
2. Mathematical Ground Truth & Derivations
Quick-Reference Lookup. All formulas below are from Hasbrouck (2007) Ch 3–4, 8 (verified per-chapter in the corpus) and Stoll (1989); the numbers in the check column were re-executed and reproduced exactly from the code in §3.
Notation: efficient price (random walk), observed trade price, buy / sell, half-spread (order-processing cost), price-impact (adverse-selection) cost, public-information innovation.
| Quantity | Definition / Formula | Verified check |
|---|---|---|
| Roll trade price | , | - |
| Return variance | - | |
| Return autocovariance | (lags ≥ 2 zero) | always under Roll |
| Roll effective spread | est vs true | |
| Efficient innovation var | - | |
| Quoted spread | ||
| Effective spread | ||
| Realized spread | ||
| Spread decomposition | per side; total | , |
| Stoll reversal params | reversal size , prob | OP: ; AI/Inv: |
The Roll algebra (why is negative). From and ,
The only serial overlap between and comes through in one and in the other, giving
and all higher autocovariances vanish because is i.i.d. and independent of . Hence the spread is identified from one number: .
Decomposition (Huang–Stoll / generalized Roll). Writing the efficient-price innovation as (a trade-driven piece plus public info), the generalized Roll model gives
So the total spread is : = order-processing/inventory, = adverse selection. Because only two autocovariances are observable but three structural parameters exist, the model is under-identified - this is why the decomposition needs trade-direction data, not just prices (see 04 · Spread Decomposition).
3. Computational Implementation - the measurement engine
This runs on the standard library only. It simulates a Roll-process price series, recovers the spread from the autocovariance, computes the quoted/effective/realized spread on a quote path, and estimates the decomposition by regression. Every number below was reproduced exactly by this code.
4. Failure Modes & First-Principles Breakdowns
Hub signposts - the folder’s failure-mode analysis lives in 05 · Failure Modes & Practice. In one line each:
- Positive autocovariance. The estimator needs ; momentum, clustering, or any persistence in the efficient returns can flip it positive and the square root breaks ( of a negative).
- Serial-correlated order flow. Buys-follow-buys (real data: ) biases the Roll spread downward (Hasbrouck Ex 4.2).
- Correlated trade direction and information () biases the Roll spread upward (Hasbrouck Ex 4.3).
- Non-stationarity / stale quotes. Roll assumes a constant spread and a stationary return series; drifting spreads, overnight gaps, and time-varying corrupt .
5. References
- Roll, Richard (1984), A simple implicit measure of the effective bid-ask spread in an efficient market, Journal of Finance 39(4), 1127–1139. *The covariance estimator
- Hasbrouck, Joel (2007), Empirical Market Microstructure, OUP
- Glosten & Harris (1988), Estimating the components of the bid/ask spread, JFE 21(1), 123–142. The transitory-vs-permanent decomposition.
- Stoll (1989), Inferring the components of the bid-ask spread: theory and empirical tests, Journal of Finance 44(1), 115–134. Order-processing vs inventory vs adverse-information via reversal probability and reversal size .
- Huang & Stoll (1997), The components of the bid-ask spread: a general approach, Review of Financial Studies 10(4), 995–1034. The three-component decomposition in one framework.
- Hasbrouck (1993), Assessing the quality of a security market, RFS 6(1)
6. Connected Graph Bridges
- Foundational base: Econometrics & Time Series (autocovariance, MA(1), stationarity) · Probability & Measure Theory (martingales, i.i.d.)
- Sibling topic: Adverse Selection & Glosten–Milgrom (why - the information half of the spread) · Limit Order Book Mechanics (quoted spread, depth, effective half-spread) · Inventory Management & Quote Skewing (the inventory half)
- Sub-pages (in-folder): 01 From Zero · 02 Quoted / Effective / Realized · 03 The Roll Model · 04 Spread Decomposition · 05 Failure Modes & Practice · 06 Advanced Extensions
- Cross-pillar: Market Microstructure & Order Types · Optimal Execution