Basic Prerequisites: Bayesian Statistics and 01 · From Zero.
1. Intuition & Practical Objective
Every trade is an unresolved mystery: is this buyer informed (they know the price is going up) or uninformed (they just need to sell for cash)? The two types are observationally tangled - both hit your ask. This page is about type detection: how to use the pattern of order flow to update your belief that you are trading against someone who knows something.
The objective: build the inference machinery that the market maker uses every round. It has three ingredients:
- The informed trader is directionally committed. They trade only in the direction of their (private) information. Uninformed traders’ directions are coin flips. So a concentrated run of one-sided buys is statistically much more likely to be informed-driven than a balanced mix.
- The prior matters. If you believe insiders are rare ( small), a single buy is weak evidence; a streak of buys is strong. The Bayesian posterior compresses all of this into one number: .
- Not every buy is toxic. is generally larger than - a buy is a mild signal - but it is only overwhelming for large or long streaks. This quantification is the core of “toxicity.”
The tester’s habit. Whenever you see flow, first ask what would posterior be if this trader were uninformed? - the answer is “noisy around .” Informed traders push in a consistent direction. Deviation from the noise benchmark is the signal.
2. Mathematical Ground Truth & Derivations
In the GM economy, informed traders buy with probability when and sell with probability when ; uninformed buy or sell with probability . The condition matters: an informed trader buys only in the high state, so
(Equivalently, conditioned on the state, - the arrival law used on 03 · The Glosten–Milgrom Model. Conditioning on instead would give , which is only correct in the degenerate case.)
Probability that a buy came from an informed trader (Bayes):
which equals at the symmetric prior and exceeds it only when . That is the right reading of the model: at a symmetric prior a buy tells you about , not about whether the trader was informed ( while ). The informed-ness becomes visible in the streak: after a run of buys the conditional rises, and a further buy is then genuinely more likely to be informed flow. At and : ; at it is .
Posterior belief that value is high after observing a buy at prior (the GM update, repeated here explicitly):
For a run of buys the update compounds. A sequence of buys moves (value-revealed as high), a sequence of sells moves it to . The interesting, non-obvious content: the speed of learning is driven by . Larger ⇒ each buy is more likely informed ⇒ posterior moves faster (Foucault Ch 3; Hasbrouck Ch 5).
3. Computational Implementation - type detection and streak diagnostics (stdlib only)
Read the numbers as a toxicity screen: at a single buy barely moves the posterior (), but ten consecutive buys push it to - you should now be quoting a heavily skewed book, not symmetric. Conversely a buy followed by five sells over-shoots the posterior below 0.5 () - classic back-and-forth noise. Directional persistence, not any single order, is what identifies information. This is the seed of order-flow-imbalance (OFI) and Volume-Synchronized probability of toxicity measures.
4. Failure Modes & First-Principles Breakdowns
- Treating each order as independent noise. The toxic agent trades in one direction persistently. Averaging over “order flow is balanced” hides the local one-sidedness that is exactly the signal. Use run-lengths / imbalance windows, not per-order classification.
- Ignoring the base rate. If insiders are genuinely rare (), even a buy streak is weak. Over-flagging noise as toxicity gets you killed on opportunity cost; under-flagging gets you killed by the informed. The posterior quantifies the trade.
- Believing the market maker “can’t see” the signal. The maker’s belief is what matters - is the maker’s belief about informed probability, which updates with experience (Hasbrouck Ch 5: “the stock doesn’t know that you own it”). A stale makes detection lag reality. The GM dynamics describe beliefs, not the true composition of traders.
5. References
- Glosten & Milgrom (1985), JFE 14 (sequential Bayes; belief dynamics; martingale transaction prices).
- Hasbrouck (2007), Empirical Market Microstructure
- Easley, Kiefer & O’Hara (1997), The information content of the trading process, JFE 44
- Foucault, Pagano & Röell (2013), Market Liquidity
6. Connected Graph Bridges
- Back: 01 · From Zero · Index Hub
- Forward: 03 · The GM Model (the full quoting solver)
- Sibling: Toxic Order Flow & VPIN · Order Flow & OFI