Paper 05 Microstructure Spreads Execution Adverse Selection

Market Microstructure: Bid-Ask Spread Dynamics

Quoted, effective, and realized spreads as microstructure state variables. Decomposing the cost of immediacy for execution models.

Abstract

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

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.

Quoted Spread
$$\text{Quoted Spread}_t = Ask_t - Bid_t$$
Midpoint
$$M_t = \frac{Ask_t + Bid_t}{2}$$

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):

Effective Spread
$$\text{Effective Spread}_t = 2 D_t (P_t - M_t)$$

The realized spread compares the execution price to a later midpoint \(M_{t+\Delta}\), showing ex-post dealer revenue net of information effects:

Realized Spread
$$\text{Realized Spread}_t = 2 D_t (P_t - M_{t+\Delta})$$

Why Do Spreads Widen?

Python Implementation

spreads.py Python
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.