5D Library › High-Frequency Limit Order Book Microstructure, Hawkes Self-Exciting Point Processes and Adverse-Selection Flow Toxicity · 中文
Chapter 1 Information Asymmetry and the Bid–Ask Spread: Glosten–Milgrom and Kyle
Where the spread comes from
In any market with a dealer (or with continuous limit-order providers), the bid is below the ask. Textbooks usually divide the spread into three parts: the cost of processing orders; the risk the dealer bears by holding inventory; and the losses from trading with people who know more (O’Hara 1995; Hasbrouck 2007). The second part was first modelled by Ho and Stoll with dynamic programming: a risk-averse dealer facing uncertain returns adjusts her quotes according to her inventory (Ho and Stoll 1981); that thread is taken up in Chapter 2. The third part is the subject of this chapter. Copeland and Galai viewed a dealer’s quotes as options written free of charge to everyone: someone who knows the true value exercises only when the quote is “wrong”, and the dealer must recover these losses from uninformed traders (Copeland and Galai 1983).
This chapter discusses two classic frameworks that turn the idea into an equilibrium model.
Note
On names. The author’s framework calls the 1985 sequential-trade model “Grossman–Milgrom”. After checking, its authors are Lawrence R. Glosten and Paul R. Milgrom, Journal of Financial Economics 14(1), pages 71–100 (Glosten and Milgrom 1985). Sanford J. Grossman is a co-author of the Grossman–Stiglitz paper of 1980, “On the impossibility of informationally efficient markets” (Grossman and Stiglitz 1980), mentioned briefly at the end of this chapter. Further, Glosten–Milgrom is a sequential-trade model; “sequential auctions” and “continuous auctions” are the two settings of Kyle (1985) (Kyle 1985).
Glosten–Milgrom: every trade is a signal
The set-up is simple. The asset’s true value is either or , and the dealer’s prior is . In each period one trader arrives and trades one unit. With probability he is an informed trader who knows and buys if it is high and sells if it is low; with probability he is a noise trader who buys or sells with probability one-half each. The dealer is risk-neutral and competitive, with zero expected profit, so her ask equals the expectation of conditional on “the arrival buys” and her bid the expectation conditional on “the arrival sells”:
After the trade she updates by Bayes’ rule and quotes for the next period. At , substitution gives : the spread is proportional to the share of informed traders. There is no order-processing cost and no inventory risk here; the spread comes entirely from adverse selection.
Evidence
Glosten and Milgrom proved several general properties of the model (Glosten and Milgrom 1985): transaction prices form a martingale (the dealer’s conditional expectation); as trading proceeds, prices converge to the true value and the spread narrows; and the size of the spread depends on the share of informed traders and the precision of their information. They also noted that when liquidity traders are price-elastic and adverse selection is severe enough, the dealer may be unable to find any quotes that break even, and the market shuts down (Chapter 4 reproduces this with a program).
The program below takes , and a prior of one-half. It first lists the initial quotes for various informed shares, then simulates 60 trades (with true value ), and finally looks at the consequences of the dealer underestimating the informed share.
Calculation
# Glosten-Milgrom (1985) sequential-trade model. The asset is worth V_H = 101 or V_L = 99
# (prior 1/2). Each period one trader arrives: informed with probability mu (buys if V_H,
# sells if V_L) or uninformed (buys or sells with probability 1/2 each). A competitive,
# risk-neutral dealer sets ask = E[V | buy] and bid = E[V | sell] and updates her belief.
import random, statistics
VH, VL = 101.0, 99.0
def quotes(pi, mu):
pbh, pbl = mu + (1 - mu) / 2, (1 - mu) / 2 # P(buy | V_H), P(buy | V_L)
pb = pi * pbh + (1 - pi) * pbl
ask = (pi * pbh * VH + (1 - pi) * pbl * VL) / pb
psh, psl = 1 - pbh, 1 - pbl
ps = pi * psh + (1 - pi) * psl
bid = (pi * psh * VH + (1 - pi) * psl * VL) / ps
return bid, ask, pi * pbh / pb, pi * psh / ps # posteriors after buy / sell
def session(rng, mu, mu_dealer, n=60, v=VH):
pi, pnl_inf, pnl_noise, spreads = 0.5, 0.0, 0.0, []
for _ in range(n):
bid, ask, pi_b, pi_s = quotes(pi, mu_dealer)
spreads.append(ask - bid)
if rng.random() < mu: # informed trader
side, who = (1 if v == VH else -1), "inf"
else:
side, who = (1 if rng.random() < 0.5 else -1), "noise"
gain = (ask - v) if side == 1 else (v - bid) # dealer's gain on this trade
if who == "inf":
pnl_inf += gain
else:
pnl_noise += gain
pi = pi_b if side == 1 else pi_s
return spreads, pnl_inf, pnl_noise, pi
if __name__ == "__main__":
print("spread at the prior (pi = 1/2) equals mu x (V_H - V_L):")
print(" mu bid ask spread")
for mu in (0.0, 0.1, 0.3, 0.5, 0.9):
b, a, _, _ = quotes(0.5, mu)
print(f" {mu:.1f} {b:7.3f} {a:7.3f} {a - b:6.3f}")
rng = random.Random(1985)
print("60 trades, true value V_H, 20,000 sessions per row (dealer knows mu):")
print(" mean spread at trade P(pi_60 dealer P&L per trade")
print(" mu t=1 t=10 t=30 t=60 > 0.99) informed noise total")
for mu in (0.1, 0.3, 0.5):
S, I, N, P = [], [], [], []
for _ in range(20_000):
sp, pi_, pn, pf = session(rng, mu, mu)
S.append(sp); I.append(pi_ / 60); N.append(pn / 60); P.append(pf > 0.99)
m = [statistics.fmean(s[t] for s in S) for t in (0, 9, 29, 59)]
i, nn = statistics.fmean(I), statistics.fmean(N)
print(f" {mu:.1f} " + " ".join(f"{x:.3f}" for x in m)
+ f" {statistics.fmean(P):.3f} {i:+.4f} {nn:+.4f} {i + nn:+.4f}")
print("dealer underestimates toxicity (true mu 0.3; V_H and V_L equally often):")
for md in (0.3, 0.2, 0.1, 0.05):
tot = []
for k in range(20_000):
v = VH if k % 2 == 0 else VL
_, pi_, pn, _ = session(rng, 0.3, md, v=v)
tot.append((pi_ + pn) / 60)
se = statistics.stdev(tot) / len(tot) ** 0.5
print(f" dealer's mu {md:.2f}: P&L per trade {statistics.fmean(tot):+.4f}"
f" (s.e. {se:.4f})")
# spread at the prior (pi = 1/2) equals mu x (V_H - V_L):
# mu bid ask spread
# 0.0 100.000 100.000 0.000
# 0.1 99.900 100.100 0.200
# 0.3 99.700 100.300 0.600
# 0.5 99.500 100.500 1.000
# 0.9 99.100 100.900 1.800
# 60 trades, true value V_H, 20,000 sessions per row (dealer knows mu):
# mean spread at trade P(pi_60 dealer P&L per trade
# mu t=1 t=10 t=30 t=60 > 0.99) informed noise total
# 0.1 0.200 0.183 0.153 0.120 0.012 -0.0698 +0.0694 -0.0003
# 0.3 0.600 0.307 0.092 0.018 0.930 -0.0526 +0.0526 +0.0001
# 0.5 1.000 0.169 0.006 0.000 1.000 -0.0234 +0.0232 -0.0002
# dealer underestimates toxicity (true mu 0.3; V_H and V_L equally often):
# dealer's mu 0.30: P&L per trade -0.0001 (s.e. 0.0002)
# dealer's mu 0.20: P&L per trade -0.0216 (s.e. 0.0002)
# dealer's mu 0.10: P&L per trade -0.0761 (s.e. 0.0002)
# dealer's mu 0.05: P&L per trade -0.1494 (s.e. 0.0003)The first table confirms : a spread of 0.2 with an informed share of 0.1, and 1.0 with 0.5. The second shows that how fast the spread narrows depends on : with an informed share of 0.5 the spread has shrunk from 1.000 to 0.169 by the tenth trade, and after 60 trades the dealer is almost certain of the true value; with an informed share of 0.1 the spread is still 0.120 after 60 trades, and the posterior exceeds 0.99 in only 1.2 % of sessions. When there is little information in the flow, prices learn slowly.
The last three columns show what “zero profit” means: with the dealer loses 0.0698 per trade on average to informed traders and earns 0.0694 per trade from noise traders; the two cancel, the total being zero within simulation error. The spread that noise traders pay is the information rent transferred to the informed. The final part fixes the true informed share at 0.3 and has the dealer quote on a lower share: thinking it is 0.2, she loses 0.0216 per trade on average; 0.1, 0.0761; 0.05, 0.1494. Underestimating “toxicity” brings a systematic loss; this is the model basis of the concept of order-flow toxicity in Chapter 4.
Kyle: the insider hides in the noise
In Glosten–Milgrom the informed trader can trade only one unit at a time. Kyle’s 1985 model lets the informed trader choose how much to trade (Kyle 1985). The asset is worth ; one insider knows ; noise traders submit ; the market maker sees only the total order flow and sets the zero-profit price .
Book 39 derived the one-period equilibrium and checked it by simulation: the insider’s order is with ; the price is with ; after trading the price has absorbed only half of the private information (), and the insider’s expected profit is . Here we only recap these results; this chapter is concerned with the multi-period and continuous-time cases.
Sequential auctions. Divide the trading session into auctions, with noise variance in each. Kyle’s Theorem 2 gives the difference equations of the linear equilibrium: the insider’s order in auction is , with
with terminal conditions and second-order condition . Here and are the coefficients of the insider’s value function, and the expected total profit is . The first two equations together give a cubic in ; the system is homogeneous, so one can set , work backwards and rescale at the end to .
Continuous auctions. As , Kyle proved that the equilibrium converges to a continuous-time limit: is constant, , the insider’s trading intensity grows towards the close, and the expected total profit is , exactly twice the one-period value; the price is a Brownian motion, and all private information is in the price by the end of trading.
Calculation
# Kyle (1985) sequential auctions: N equally spaced auctions on [0, 1], v ~ N(0, S0),
# noise order flow u_n ~ N(0, su2 * dt). Backward recursion of Kyle's Theorem 2:
# 2 lam^2 su2 dt (1 - a lam) = S_n (1 - 2 a lam) (lam_n, with a = alpha_n)
# beta_n dt = lam_n su2 dt / S_n, S_{n-1} = S_n / (1 - beta_n lam_n dt)
# alpha_{n-1} = 1 / (4 lam_n (1 - alpha_n lam_n))
# delta_{n-1} = delta_n + alpha_n lam_n^2 su2 dt
# with alpha_N = delta_N = 0. The system is homogeneous: solve with S_N = 1, then rescale
# so that S0 = 1 (lam and profits scale with sqrt(S), alpha with 1/sqrt(S)).
# Monte Carlo lines show simulated values with the recursion's values in brackets.
import math, random, statistics
def kyle(N, su2=1.0):
dt = 1.0 / N; S, a, d = 1.0, 0.0, 0.0; lam, bdt, Ss = [], [], [1.0]
for _ in range(N):
lo, hi = 0.0, (1 / (2 * a) if a > 0 else 1e6)
for _ in range(200): # bisection for lam_n
m = (lo + hi) / 2
f = 2 * m * m * su2 * dt * (1 - a * m) - S * (1 - 2 * a * m)
lo, hi = (m, hi) if f < 0 else (lo, m)
L = (lo + hi) / 2; b = L * su2 * dt / S
d, a = d + a * L * L * su2 * dt, 1 / (4 * L * (1 - a * L))
S = S / (1 - b * L); lam.append(L); bdt.append(b); Ss.append(S)
c = 1 / S # rescale to S0 = 1
lam = [x * math.sqrt(c) for x in reversed(lam)]
bdt = [x / math.sqrt(c) for x in reversed(bdt)]
Ss = [x * c for x in reversed(Ss)]
profit = (a * S + d) * math.sqrt(c)
return lam, bdt, Ss, profit
def monte_carlo(N, rng, n=100_000):
lam, bdt, _, _ = kyle(N); prof, err = [], []
for _ in range(n):
v, p, pi = rng.gauss(0, 1), 0.0, 0.0
for k in range(N):
x = bdt[k] * (v - p); p += lam[k] * (x + rng.gauss(0, math.sqrt(1 / N)))
pi += x * (v - p)
prof.append(pi); err.append((v - p) ** 2)
return statistics.fmean(prof), statistics.fmean(err)
if __name__ == "__main__":
print("S0 = 1, noise variance 1 per unit time. Continuous limit: lam = 1, profit 1,")
print("Sigma(t) = 1 - t. One auction: lam = 0.5, profit = 0.5, Sigma_1 = 0.5.")
print(" N lam_1 lam_mid lam_N Sigma(1/2) Sigma_N insider profit")
for N in (1, 2, 4, 16, 64, 256, 1024):
lam, bdt, Ss, pr = kyle(N)
mid = f"{Ss[N // 2]:9.4f}" if N > 1 else " -"
print(f" {N:4d} {lam[0]:.4f} {lam[N // 2] if N > 1 else lam[0]:.4f}"
f" {lam[-1]:.4f} {mid} {Ss[-1]:.4f} {pr:.4f}")
rng = random.Random(1315)
for N in (1, 16):
pr_mc, e = monte_carlo(N, rng)
print(f"Monte Carlo, N = {N:2d}, 100,000 runs: profit {pr_mc:.3f}"
f" ({kyle(N)[3]:.3f}); E(v - p_N)^2 {e:.3f} ({kyle(N)[2][-1]:.3f})")
# S0 = 1, noise variance 1 per unit time. Continuous limit: lam = 1, profit 1,
# Sigma(t) = 1 - t. One auction: lam = 0.5, profit = 0.5, Sigma_1 = 0.5.
# N lam_1 lam_mid lam_N Sigma(1/2) Sigma_N insider profit
# 1 0.5000 0.5000 0.5000 - 0.5000 0.5000
# 2 0.6529 0.5882 0.5882 0.6920 0.3460 0.6206
# 4 0.7648 0.7372 0.6642 0.6375 0.2206 0.7307
# 16 0.9012 0.8979 0.7707 0.5647 0.0742 0.8860
# 64 0.9638 0.9635 0.8231 0.5262 0.0212 0.9592
# 256 0.9881 0.9881 0.8437 0.5093 0.0056 0.9869
# 1024 0.9963 0.9963 0.8508 0.5030 0.0014 0.9960
# Monte Carlo, N = 1, 100,000 runs: profit 0.504 (0.500); E(v - p_N)^2 0.502 (0.500)
# Monte Carlo, N = 16, 100,000 runs: profit 0.882 (0.886); E(v - p_N)^2 0.074 (0.074)The program confirms these results. With , λ, the profit and are all 0.5; as grows, the λ of the first auction rises from 0.5 to 0.9963, the expected profit from 0.5 to 0.9960, the variance left at the end falls from 0.5 to 0.0014, and the variance at mid-session approaches (0.5030). Monte Carlo simulation (100,000 runs each) agrees with the recursion: with the simulated profit is 0.882 against 0.886 from the recursion, and the remaining variance is 0.074 in both. One detail is worth pointing out: the λ of the last auction converges very slowly (0.8508 with ); this is a boundary effect at the close that affects an instant of measure zero and does not change the limiting results.
Figure 1 shows, on the left, the mean spread in the Glosten–Milgrom model and, on the right, the path of the posterior variance over time in Kyle’s model: the more frequent the auctions, the closer the path by which information enters the price is to the straight line .
The common message of the two models is that price impact and spreads are the price of information asymmetry. Kyle’s λ later became the standard notion of “market depth” ( is the order flow needed to move the price by one unit) (Bouchaud et al. 2018); but note that it is an equilibrium parameter of the model, and whether a regression coefficient estimated from data equals it depends on whether the model holds.
Grossman–Stiglitz: why anyone gathers information
If prices fully reflected information, no one would pay to gather it; but if no one gathered information, how would prices come to reflect it? Grossman and Stiglitz showed in 1980 that an informationally efficient equilibrium cannot exist when information is costly; equilibrium must retain some “noise”, so that the informed earn just enough to cover the cost of their information (Grossman and Stiglitz 1980). In both models above, noise traders play exactly this part: without them the market maker would trade only with the informed, and the spread would become so wide that no one traded. This also points to an often-overlooked fact: “noise traders lose to adverse selection” is part of the equilibrium, not a defect that can be removed.
Hypothesis · not established · Insufficient quote revision
The author’s hypothesis (not established): in trade-by-trade data, market makers’ revision of quotes in response to trade direction (Bayesian updating of the Glosten–Milgrom kind) is systematically insufficient in periods when informed trading is concentrated, so that realized spreads in those periods are significantly lower than in other periods. What would show it wrong: with a definition of “periods of concentrated informed trading” written down in advance (for instance, fixed windows around announcements) and a comparison period, a confidence interval for the difference in realized spreads that includes zero or is positive. The test needs real trade and quote data and is not carried out in this book.
Chapter summary
Part of the spread is the cost of trading with the informed. In the Glosten–Milgrom model the spread comes entirely from adverse selection; with a prior of one-half it equals the informed share times the difference in values, and it narrows as trading reveals information. The dealer’s gains from noise traders exactly offset her losses to the informed, and underestimating the informed share brings systematic losses. In Kyle’s model the insider hides his orders in the noise; the price-impact coefficient of the continuous auction, , is twice the one-period value, and information enters the price linearly. The name in the author’s framework has been corrected to Glosten.
References
Fan, Y. (2026). High-Frequency Limit Order Book Microstructure, Hawkes Self-Exciting Point Processes and Adverse-Selection Flow Toxicity: From the Avellaneda–Stoikov Market-Making Equations to VPIN, Read Beside Classical Chinese Thought on Market Equilibrium [高频限价订单簿微观结构、霍克斯自激点过程与逆向选择毒流] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23828065 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).