Market Microstructure: Bid-Ask Spread Dynamics
Quoted, effective, and realized spreads as microstructure state variables. Decomposing the cost of immediacy for execution models.
The bid-ask spread is far more than a simple transaction cost — it is a compressed summary of inventory risk, adverse selection, and market-maker expectations about future order flow. This paper formalizes quoted, effective, and realized spreads as microstructure state variables and provides a Python implementation for decomposing the cost of immediacy in execution models.
Key Takeaways
- The quoted spread captures the raw cost of crossing the book; the effective spread measures actual execution quality relative to the midpoint.
- The realized spread isolates ex-post dealer revenue net of information effects, revealing the adverse selection component.
- Spread widening is driven by inventory risk, processing costs, and adverse selection from informed order flow.
- Microstructure-aware models must treat spread alongside depth imbalance, cancellation rates, and order flow — not in isolation.
Spread Decomposition
At the surface, the bid-ask spread looks trivial. But in market microstructure, the spread is not merely a transaction cost — it is a compressed summary of inventory risk, adverse selection, tick-size constraints, queue competition, and market-maker expectations about future order flow.
The effective spread measures how far the trade price deviates from the midpoint, adjusted for trade direction (\(D_t = +1\) for buyer-initiated, \(D_t = -1\) for seller-initiated):
The realized spread compares the execution price to a later midpoint \(M_{t+\Delta}\), showing ex-post dealer revenue net of information effects:
Why Do Spreads Widen?
- Inventory risk: dealers need compensation when they accumulate too much long or short exposure
- Processing costs: technology, clearing, capital, and exchange fees
- Adverse selection: if incoming orders are likely informed, a passive market maker expects to lose on average after the trade
Python Implementation
import pandas as pd import numpy as np def compute_spreads(df: pd.DataFrame, horizon=5) -> pd.DataFrame: out = df.copy() out["mid"] = (out["bid"] + out["ask"]) / 2 out["quoted_spread"] = out["ask"] - out["bid"] out["effective_spread"] = 2 * out["trade_sign"] * (out["trade_price"] - out["mid"]) out["mid_future"] = out["mid"].shift(-horizon) out["realized_spread"] = 2 * out["trade_sign"] * (out["trade_price"] - out["mid_future"]) out["price_impact"] = out["effective_spread"] - out["realized_spread"] return out
Spread behavior is endogenous — it reflects the interaction between the limit order book and expected future price movement. This is why microstructure-aware models often include spread, queue position, depth imbalance, cancellation rates, and order flow imbalance together rather than in isolation. The spread is the market's local price of immediacy.
Related Research
- Sentiment Analysis in the Turkish Market (BIST) — Building a financial NLP pipeline with Qwen and Llama
- Sovereign AI: Local LLMs for Quant Research — Why self-hosted models are structurally superior for investment research
- Automating Alpha Discovery with Genetic Algorithms — Evolutionary search for automated signal generation
- All Research Papers — Full paper collection on QuantMedia