Act VI · Market Microstructure
Part 35 of 43Who Trades With Whom
Why is there a spread between the price to buy and the price to sell, and what do an insider's orders reveal?
A dealer who quotes two prices has two problems. Inventory: every trade leaves a position that must be carried. Information: some of the people trading know more. Glosten and Milgrom show the spread is insurance against the informed, paid by everyone else; Kyle shows how an insider hides in the noise and how prices absorb the information anyway. The part then measures these things from data alone: the spread implied by price reversals, the price impact per unit of order flow, the share of trading that is toxic, and where price discovery happens when the same asset trades in two places. The flash crash is the day liquidity left.
What you need. Parts 2 and 4 (Bayes' rule is enough for most of it).
What you will be able to do
Undergraduate
- Explain the bid-ask spread as compensation for inventory risk and adverse selection.
- Update a dealer's belief after a buy or a sell with Bayes' rule.
Master's
- Derive Glosten-Milgrom quotes and Kyle's one-period equilibrium with its lambda.
- Estimate the effective spread (Roll), price impact (Kyle's lambda, Amihud) and information shares (Hasbrouck) from data.
PhD
- Solve Kyle's model in continuous time: the insider's bridge strategy, constant depth, and the verification argument (Kyle; Back).
Industry
- Describe market structure: lit and dark venues, wholesalers, maker-taker fees, circuit breakers; explain what happened on 6 May 2010.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 15 min · Master's 51 min · PhD 60 min · Industry 30 min.
- 0What an insider's orders revealUndergraduate2 min
- 1The dealer's problemUndergraduate3 min
- 2Glosten and Milgrom: the spread as insuranceUndergraduate4 min
- 3Kyle: how an insider trades, and what it costsMaster's5 min
- 4Measuring the spread from prices aloneMaster's3 min
- 5Kyle's lambda, measuredMaster's5 min
- 6Toxic flow: PIN and VPINMaster's4 min
- 7Price discovery across marketsMaster's4 min
- 8Market structure: the plumbingIndustry5 min
- 9High-frequency traders as market makersIndustry3 min
- 10When liquidity vanishesIndustry4 min
- 11Rule 35: know who is on the other sideIndustry4 min
- For the researcher: Kyle in continuous timePhD8 min
- Recap, desk questions, problemsAll tracks5 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
What an insider's orders revealUndergraduate2 min
Who trades with whom: the dealers, the informed and the rest, and what their orders reveal. Act six begins: market microstructure.
One trader knows the terminal value in a specified Gaussian market. The competitive dealer sees total order flow, not the trader identities. In the continuous-time equilibrium the insider trades gradually among independent noise orders, and the price converges to that value at the fixed horizon. The plotted Euler approximation retains a small final-step noise error; exact endpoint learning belongs to the limiting theorem. We will separate that model from descriptive measurements of real order flow.
Three distinctions. The same-minute Bitcoin flow slope is 4.6 basis points per million dollars. It is a descriptive association, not the causal cost of a chosen order. Daily-price and bulk-volume measures depend on assumptions; volatility can contaminate their interpretation, and different imbalance statistics must not be called ground truth for each other. Finally, a theorem in a specified Gaussian equilibrium: continuous-time profit is twice one-auction profit when the horizon and total noise variance are matched. Its assumptions and verification matter.
Where this sits. Act five built strategies and the firm. Act six goes inside the trade itself: this part, who trades with whom; then the limit order book, execution, market making, and digital-asset markets. It uses Part four's martingales, Part seven's filters, Part eight's control, and Part thirty-one's impact.
Fifty years of the field. Mark Garman named it in 1976; Ho and Stoll, Roll, then Kyle and Glosten and Milgrom in 1985, and Back's continuous-time proof in 1992. Then measurement: Hasbrouck's price discovery, PIN, Amihud's illiquidity, and the rules that built today's fragmented American market. And the electronic era: the flash crash, VPIN, batch auctions, and next-day settlement.
The plan: the dealer's inventory problem; Glosten and Milgrom's spread; Kyle's insider; measuring liquidity from prices; Kyle's lambda measured on Bitcoin; toxic flow; price discovery between spot and futures; the plumbing of American markets; high-frequency market makers; the flash crashes and batch auctions; and Kyle's model in continuous time, proved.
In the House, this part proposes data and compliance tools: a public signed-flow feed, quote-based execution measurements and evidence review. These are research examples and design requirements. They do not establish a deployed surveillance system, identify illegal intent or authorize a trade.
1The dealer's problemUndergraduate3 min
Every trade has two sides, and on most markets one side is a dealer: someone who quotes a price to buy and a price to sell, all day, to anyone. In 1976 Mark Garman gave the field its name, market microstructure, by asking what that dealer must do to survive.
Garman's model. Buy arrivals become less frequent as the ask rises. Sell arrivals become less frequent as the bid falls. With balanced independent arrivals, inventory behaves like a random walk. It eventually exits fixed inventory limits under the usual nondegeneracy conditions. That is not by itself a proof of financial ruin: wealth also depends on spread income, prices and capital. Inventory control addresses a real risk without that stronger claim.
Ho and Stoll explain why inventory changes quotes. Our illustration specifies a linear heuristic: shift the mid below fair value by a constant times long inventory. It is not the solution of an optimal-control problem. Keep a fixed spread around that mid. Arrival probabilities fall exponentially with nonnegative quote distance and are capped at one. Lowering both quotes encourages selling inventory and discourages buying more. Part eleven solves a related utility model under its own assumptions.
Simulated, twenty thousand arrivals. Without shading, the inventory wanders off into the hundreds of units. With shading, it stays within a few units of zero, because every trade that adds to it makes the next one less likely.
Part eleven made this optimal. In Marco Avellaneda and Sasha Stoikov's model the dealer's reservation price is the value minus its inventory times risk aversion times the variance it still has to carry. The best total spread has two parts: inventory risk, and a part set by how fast customers stop trading as the quote moves away. More volatility, more time left, or more risk aversion: more shading and wider quotes. Ho and Stoll's two effects, made exact.
The stipulated simulation across twenty seeds. Read terminal mean profit and its across-seed standard deviation separately; shading also changes which arrivals execute. The mean divided by that standard deviation is 3.1 without shading and 43 with it. This is a terminal-outcome ratio, not an annualized time-series Sharpe, confidence interval or proof of an optimal quote policy. The table describes these chosen parameters.
Who the dealers are today. The New York Stock Exchange once gave each stock one specialist, with a duty to keep an orderly market; today designated market makers have quoting obligations and privileges at the auctions. Most bonds and currencies still trade with dealers, by request for a quote, and the dealers' balance sheets are the market's inventory. Everywhere else, algorithms quote thousands of instruments, with inventory limits in place of a specialist's capital: Chapter nine's subject.
So a spread has three parts. Order processing: the cost of being there at all. Inventory: the risk of holding what customers sold, paid for by a spread that widens with volatility and with the position. And adverse selection: some customers know more than the dealer. That part survives even among competitive, risk-neutral dealers, and it is the subject of the next two chapters.
Pause and predict. Under the stated quote heuristic, inventory is forty, shading is point zero five per unit and full spread is one. Derive bid and ask relative to fair value. State what the calculation assumes.
2Glosten and Milgrom: the spread as insuranceUndergraduate4 min
Suppose dealers are competitive, so they earn nothing on average, and do not mind risk, so inventory costs nothing. Is there still a spread? In 1985 Lawrence Glosten and Paul Milgrom showed there must be, and Part eleven ran their market. Here it is derived.
The model. An asset is worth one or nothing; the market believes one with probability p. A fraction mu of traders know the value and trade on it. The rest buy or sell at random, for their own reasons. And the dealer is competitive and risk-neutral: it expects to make nothing on each trade.
The quotes. To make nothing on a buy, the ask must equal the value expected given that someone chose to buy. The trade itself is information. By Bayes' rule a buy is more likely when the value is high, because the informed buy then. From an even prior, the ask is one plus mu over two, the bid one minus mu over two, and the spread is exactly mu: the share of informed traders. The uninformed pay the spread; the dealer passes it to the informed.
With numbers. Three in ten traders informed, and an even prior: a bid of point three five and an ask of point six five. Once the belief has moved to point eight, the quotes rise and the spread narrows, to 0.20. And as the market becomes sure, the spread vanishes: there is nothing left for the informed to know.
Four hundred paths, each conditioned on true value one. The initial spread equals mu and typically narrows as beliefs learn. With more informed arrivals it starts wider. For mu point three the saved median crossing index is 22. The arrays record beliefs before each trade, through seventy-nine updates; a non-crossing path receives the sentinel eighty. This is a capped, conditional summary, not an uncensored population learning time.
The price path. Buys and sells update the dealer's belief by Bayes' rule. The average shown rises because every simulation here conditions on the high true value. Under the full prior mixture and the dealer's own information, the correctly specified conditional expectation is a martingale. Conditional drift when the value is fixed high does not contradict that statement. Finite eighty-trade paths need not learn the value exactly.
Odds make the update simple. A buy multiplies the odds by one plus mu over one minus mu; a sell divides by the same factor. Starting from equal odds, strictly crossing ninety-nine percent requires an integer net-buy count above the displayed logarithmic threshold. At mu point three that real-valued threshold is 7.4. Dividing by drift mu gives roughly 25 trades, only a heuristic. The saved capped median index is 22; these are different statistics, and non-hits are censored at eighty.
The model's predictions, as studies have found them. Spreads widen and depth thins before scheduled news, when the share of traders who may know more is highest. Once the news is public, spreads narrow even though volatility is high, a test that separates information from inventory. And small, obscure stocks, with fewer analysts and more room for private information, carry wider spreads for the same volume.
The lessons. The spread is not the dealer's profit: competitive dealers collect it from the uninformed and lose it to the informed. The uninformed pay for price discovery. And if the informed are numerous enough, the spread exceeds what anyone else will pay, and trade stops: George Akerlof's market for lemons, in a quote.
Pause and predict. Start from an even prior with forty percent informed in the binary-value model. Observe one buy. Derive the new belief and then the next ask and bid; distinguish the executed ask from the next quotes.
3Kyle: how an insider trades, and what it costsMaster's5 min
Glosten and Milgrom fixed the trade size at one. In 1985 Albert Kyle let the informed trader choose how much to trade, knowing that a bigger order moves the price further. The answer gives the field its most used number: lambda, the price impact of order flow.
The one-auction model. Value is Gaussian around the public prior mean; a risk-neutral insider observes it. Independent zero-mean Gaussian noise submits an order with the stated variance. The insider chooses its own order before observing that noise. Competitive risk-neutral dealers observe only total flow and clear at its conditional expected value. These information and independence assumptions produce the linear equilibrium; a real return-on-flow regression does not establish them.
Guess that both sides are linear. The insider trades in proportion to the mispricing, with intensity beta. The market maker moves the price in proportion to the flow, with impact lambda. Given beta, the break-even lambda is a regression coefficient: the covariance of value with flow over the flow's variance.
The insider's side. Given lambda, its expected profit is the mispricing times its order, minus lambda times the order squared: a downward parabola. Its peak is the mispricing over two lambda. The insider trades only half as hard as it could, because every unit moves the price against itself.
Put the two together. Beta is sigma u over sigma v, and lambda is sigma v over two sigma u. The insider scales its order to the noise: it always trades exactly as much as the camouflage allows. The price impact rises with what there is to know, and falls with how much noise hides it. The insider expects half of sigma u sigma v, and the price reveals half of the value's variance.
Checked by simulation. The insider's profit, the noise traders' loss and the remaining uncertainty all match the theorem. And the first two are the same number: the market maker breaks even, so whatever the insider makes, the noise traders lose. That is who pays for an insider.
A best-response check against a fixed price rule. Holding lambda fixed at its equilibrium value, scaling the insider order down or up reduces expected profit along the displayed parabola. This checks the insider's optimization, with Monte Carlo variation. The dealer's conditional-expectation rule is a separate equilibrium condition. Re-solving prices after a deviation would be a different comparison.
The same unit horizon with noise variance fixed per unit time. One auction leaves half the value variance unrevealed. As the number of auctions increases, the saved recursion approaches linear decline of remaining conditional variance; finite auction counts still retain terminal uncertainty. Linear variance decline does not mean constant Shannon-information release. Initial impact changes from 0.50 at one auction to 0.99 at two hundred fifty-six, approaching sigma v over sigma u in the continuous-time normalization.
Kyle also named the three dimensions of liquidity that the rest of this act measures. Tightness: the cost of turning a position round, the spread. Depth: the flow needed to move the price one unit, one over lambda. And resiliency: how fast the price recovers from a shock that carried no information. Real markets have all three; the order book of Part thirty-six measures them separately.
The two models side by side. Glosten and Milgrom fix the trade size and let the market maker see each trade's side; liquidity costs a spread; the informed are many and mechanical. Kyle lets one strategic insider choose its size, shows the market maker only the net flow, and prices liquidity by impact. In both, the price is a martingale that learns the value from the trades. The research chapter proves a specific continuous-time Gaussian Kyle equilibrium; this table alone does not establish equivalence with sequential binary-value trading.
Interpret the model label carefully. Kyle's insider is a trader with superior information. Its legal status depends on source, duties and jurisdiction; a mathematical label does not classify a real trade. Collin-Dufresne and Fos studied disclosed activist trading and reported patterns consistent with timing trades when other flow is high. These are attributed findings in their setting, not identification of every informed trader. Strategic concealment is one reason standard proxies may miss information, but quiet prices alone prove neither its presence nor its absence.
Three uses, with their limits. A return-on-flow regression produces a descriptive slope. Calling it structural equilibrium impact requires the model and an identification argument. Within Kyle, more independent noise makes the equilibrium deeper at fixed value uncertainty. The continuous-time insider trades gradually under a specific information structure. That result does not identify the optimal execution schedule of an uninformed real parent order, whose costs Part thirty-seven studies separately.
Pause and predict. Double noise variance, holding value variance fixed in the one-auction Gaussian equilibrium. Compare lambda, the insider order at a fixed value gap and unconditional expected profit. Variance doubling means standard deviation grows by the square root of two.
4Measuring the spread from prices aloneMaster's3 min
Researchers often have daily prices and volume but no historical quotes. Roll, Corwin and Schultz, and Amihud propose different liquidity proxies. We derive their assumptions. The planned ten-fund comparison is unavailable: its unchanged original stopped when the SPY source failed the frozen checksum. We neither refresh the source nor replace the comparison with a new backtest.
Roll's identity requires a model. Let efficient-price increments be iid, with constant full spread s and independent equiprobable trade signs, independent of those increments. Bid-ask bounce then gives lag-one covariance minus s squared over four. Negative sample covariance yields twice its negative square root, in the units of the input prices. Nonnegative covariance makes this formula undefined; it does not prove the economic spread is zero. Serial price dynamics or correlated signs can break the identity.
What the estimator sees. The efficient price wanders. Trades land half a spread above it or below it, at random, so the printed price zig-zags: up, then down, more often than a random walk would. That zig-zag is the spread.
A chosen scale calculation. In the simple iid small-bounce approximation, sample autocovariance has standard error of order daily variance divided by the square root of sample length. Two standard errors give the displayed requirement, proportional to volatility to the fourth power divided by spread to the fourth. Stipulate daily volatility one point two percent and full spread point three three basis points. The resulting order is a trillion daily observations. This is a heuristic illustrating weak signal at this frequency, not a calibrated finite-sample power result or a measured SPY quote.
Three distinct objects. Corwin and Schultz use one- and two-day high-low ranges to separate spread and volatility under their model. Our original clips negative spread estimates at zero; that convention can affect bias. Amihud averages absolute return divided by dollar volume. Its units are return per dollar, and its denominator mechanically links it to volume. It is not a signed-flow structural-impact estimate. Direct quote data allow different measurements, but minimum tick, quoted spread and effective spread must remain distinct. Daily OHLC data alone do not provide their ground truth.
The empirical boundary matters. Yahoo's extracted SPY bars for 2015 to 2020 differ from the recorded checksum. That key was rejected once, and the original stopped before producing its output. We therefore omit the ten-fund table, Bitcoin Roll result and cross-fund scatter. The mathematical examples remain explicit illustrations. An old reported spread is not a current verified result, and a minimum tick is not an observed effective spread.
With trade and quote records, define the decomposition. The effective spread is twice the trade-side-signed execution-price difference from the initial midpoint. Replace that midpoint by a specified later midpoint to obtain the realized spread. The difference equals twice the signed midpoint change. This is an accounting identity. Its interpretation depends on horizon, timestamp alignment and selection; it does not by itself identify private information or causality. The factor two expresses a full-spread equivalent rather than one-way cost.
Pause and predict. A sample lag-one covariance is minus point zero zero zero four dollars squared. Compute the Roll full-spread estimate, check its units and state the assumptions required to interpret it economically.
5Kyle's lambda, measuredMaster's5 min
To measure it you need to know which trades were buys. Bitcoin's public data says so directly: every minute, how much was bought by traders who crossed the spread.
Define the measurement. Binance records taker-buy base volume for each one-minute bar. Taker sells equal total base volume minus those buys. Twice taker buys minus total volume is net aggressive base flow. Multiplying by the bar close approximates dollars; it is not a sum of timestamped signed execution values. Regress same-bar log return in basis points on that approximate flow in millions of dollars. Returns use successive available closes, so archive gaps can compress the clock. This venue aggregate does not identify who was informed.
The descriptive fit. The slope is 4.6 basis points per million dollars. It measures same-bar association; flow and prices respond jointly to news and to one another. The stored classical iid t-statistic is 757, with R squared 0.21; it is not a heteroskedasticity- and autocorrelation-robust inference result. Flow standard deviation is 0.9 million dollars, giving a fitted change of 4 basis points per flow standard deviation. None of these is the causal execution cost of an added parent order.
Bin the observed minutes by signed flow. Each dot is a conditional sample mean; the displayed square-root curve is fitted to those selected bins. The largest positive bin has return divided by flow of 7 basis points per million dollars. This can show nonlinearity in same-minute association. It is not a forecast for executing a large parent order, and no out-of-sample curve comparison or uncertainty bands are supplied. A limit-order market still has liquidity suppliers, even without a designated dealer.
Compare the objects before comparing curves. Independent Gaussian value and noise support a linear conditional-expectation price rule in the specified Kyle equilibrium. A parent-order square-root relation concerns identified orders executed over time; our minute bins are different observations and a different estimand. Persistence, changing liquidity and non-Gaussian distributions are possible mechanisms, not conclusions established by this plot. Fat-tailed flow alone does not prove a square-root response, and a concave minute curve does not identify an optimal execution schedule.
Serial association in the saved arrays. Signed-flow autocorrelation is 0.18 at one row and 0.004 at two hundred forty rows. Rows usually represent minutes, but this helper does not reindex missing timestamps. Order slicing is one possible source of persistence, not a causal finding from autocorrelation. The plotted return autocorrelations are much smaller. That does not establish unpredictability under every information set. Anticipation and innovation-based impact can reconcile persistent flow with efficient prices, but this ACF comparison does not estimate such a model.
Monthly descriptive slopes range from 2.2 to 8.2 basis points per million dollars. Each fit reuses the research archive; variation can reflect volatility, flow scale, composition and measurement. The correlation with within-month return volatility is +0.21. It is an association across selected months, without uncertainty bands or independent structural identification. This plot does not isolate changes in private information.
And through the day. Bitcoin trades around the clock, but not evenly. Lambda moves with the hour, and its correlation with the hour's volume is +0.07. Kyle's depth is the noise to hide in, and the busiest hours are not automatically the deepest: when the busy hours are also the hours of news, both the noise and the information arrive together.
Five coins in 2024. The fitted same-minute slopes include Bitcoin at 3.5 and XRP at 31 basis points per million dollars. They are associations, not measured costs of an imposed order. The log-log slope against return volatility divided by flow volatility is 0.91. In OLS with an intercept, lambda times flow standard deviation over return standard deviation equals their sample correlation when samples match. The original marginal standard deviations differ slightly through the initial missing return. This scaling plot is therefore largely an accounting relation, not an independent test of Kyle equilibrium.
Aggregate consecutive stored rows into longer bars. From one to sixty rows, the saved slope changes from 4.6 to 3.2 and R squared from 0.21 to 0.32. These regressions use different aggregation and noise scales. They do not trace one identified trade's response, so they do not establish impact decay or isolate a permanent component. The aggregation does not repair missing calendar bars; sixty rows need not always equal one clock hour.
The practical interpretation. Same-bar regressions describe associations in this archive; a causal effect needs an identification argument. Aggregation slopes alone do not separate temporary from permanent impact. To estimate parent-order cost, specify the path, spread, fees, fills and opportunity cost. These measurements motivate further questions; they do not provide a live execution prescription.
Pause and predict. A descriptive slope is four point six basis points per million, with ten million of net flow. Find its fitted return. Separately assume a permanent linear execution path, no spread or fees, and derive average shortfall. Why is neither an identified real parent-order cost?
6Toxic flow: PIN and VPINMaster's4 min
Glosten and Milgrom's mu, the share of informed traders, sets the spread. If it could be measured, a market maker would know when to widen its quotes. Two famous attempts, and a test of the second.
PIN. David Easley, Nicholas Kiefer, Maureen O'Hara and Joseph Paperman: each day there is private news, or not. Buys and sells arrive at random, and on news days informed traders add to one side. The probability that a trade is informed is estimated from daily counts of buys and sells, by maximum likelihood. It became a standard variable in asset pricing, and a slow one: it needs many days of data.
VPIN uses an estimated classification. Split each bar's volume using the Normal cumulative probability of its standardized price change; split a bar across equal-volume buckets when necessary. Average each bucket's absolute buy-sell imbalance over fifty buckets. This is a statistic, not automatically the probability of informed trading. Our unchanged original estimates return standard deviation and mean daily volume from the full four-year sample. Bucket size is that average divided by fifty. Those full-sample choices use future observations relative to early dates, so this is an ex-post research construction, not an implemented live signal.
PIN has its own troubles. Its likelihood has many local maxima, and estimates depend on where the optimiser starts. Jefferson Duarte and Lance Young found that the part of PIN that predicts stock returns is the part related to illiquidity, not to private information. And both measures need to know which trades were buys: PIN from a trade classifier, VPIN from price moves. The classifier is the weak link, which is the test that follows.
VPIN on four years of Bitcoin, one-minute bars. It averages about 0.18, with spikes. The question is what the spikes mean.
Two selected event windows. May nineteenth, 2021, surrounds a large Bitcoin selloff. November eighth, 2022, surrounds the FTX crisis. Price is separately rescaled to each panel, while VPIN retains its own scale. These ex-post selected plots do not establish predictive lead, calibrated false-alarm rates or causality. A defensible warning study would require a predeclared rule and genuinely available inputs, not full-sample bucket and volatility estimates.
Two descriptive correlations, with an essential mismatch. VPIN correlates 0.67 with realized volatility in the selected overlapping windows. Its correlation with absolute aggregate taker imbalance is 0.09. But that comparator takes the absolute value after summing a roughly fifty-bucket whole-bar window. VPIN averages absolute imbalances within equal-volume buckets. Opposite bucket imbalances can cancel in the first statistic but not the second, and boundary bars differ. Bulk classification mechanically uses price moves. The results illustrate sensitivity, not validation against true VPIN or proof about informed trading. Overlap, full-sample calibration and lack of inference further limit the comparison.
Define whose markout is measured. Let q be the dealer's execution side: plus one for a dealer buy, minus one for a dealer sell. The displayed signed future-midpoint minus fill-price difference is favorable when positive. Use several stated horizons and consistent timestamps, grouped by venue or counterparty when lawfully known. More negative markouts are adverse to the dealer. They can reflect selection and price dynamics; they do not uniquely reveal private information or abusive intent. If one instead signs by the counterparty's side, every sign reverses. Spread income and fees also matter.
Interpretation follows construction. A statistic built from standardized price moves can inherit volatility effects; correlation alone does not quantify classifier accuracy. Use recorded taker signs where available, but align the bucket definition and boundary allocation before comparing with bulk classification. Neither identifies informed intent. A real quote policy needs a specified objective, costs and available information. This ex-post VPIN illustration does not validate a live toxicity signal or an optimal response.
Pause and predict. A thousand-bitcoin bar rises by two standardized return units. Compute the bulk-classified buy and sell volumes. Could the recorded taker split still be five hundred each? Explain what is classified and what remains unidentified.
7Price discovery across marketsMaster's4 min
Bitcoin trades both as spot and as a perpetual future. Arbitrage and funding link their prices, but differences can persist. Hasbrouck's information shares describe how a specified cointegrated model attributes common-trend innovation variance. They require synchronized prices, a stable error-correction specification and residual assumptions; they are not a causal verdict about where every piece of news first appeared.
The maintained model. Each log price contains a common stochastic trend plus market-specific components. Specify integrated prices with a common innovation. Assume their difference is stationary over the estimation window, with the chosen cointegrating vector. Arbitrage is a motivation, not a proof of that statistical assumption. Time-varying funding, basis risk and regime changes can weaken the specification; no cointegration or stability test is supplied by these plots.
The tool. Part thirty-three's error-correction model, for two prices. The loadings alpha say how strongly each market moves to close the basis. The market that does not adjust is the one the other follows, so each market's weight in the common trend is the other's speed of adjustment.
Hasbrouck's information share. The variance of the efficient price's innovation comes from the residual covariance. Each market's share of it is its information share. But when the two markets' shocks are correlated within the sampling interval, the split depends on which is ordered first, and the answer is a range.
The answer, month by month, from one-minute bars. Each bar is the range of the perpetual's information share. On average it runs from near zero to near one: a width of 0.95. At one-minute sampling, the method cannot say which market leads.
Sampling limits the interpretation. The contemporaneous return correlation is 0.987; both prices can react within the same minute. Correlated residuals make Cholesky-order attribution ambiguous in this fitted model. Minute data do not establish a particular millisecond adjustment speed. Finer synchronized data may help, but do not guarantee narrow bounds or causal identification. The model, quote-versus-trade choice, clock quality and stability still matter. A wide range is an attribution limitation, not a proof that the markets have identical roles.
An attributed historical application. Hasbrouck's study of Dow stocks and regional venues reported a dominant NYSE contribution in that setting. Historical results depend on the sample, quote records and econometric specification. Modern cross-venue studies need clocks and sampling suitable for their question; nanosecond labels alone do not guarantee synchronization or identification. Other studies often find an important futures role in particular markets. Lower transaction costs and leverage are possible explanations, not a universal causal conclusion from our Bitcoin turnover figures.
A descriptive lead-lag summary. The stored correlations are +0.020 for perpetual followed by spot and +0.001 for the reverse. The helper first filters non-one-minute increments, then lags the retained sequence. It does not ensure every adjacent retained pair is consecutive in calendar time, so gaps can compress the lag clock. Perpetual dollar turnover is 5.3 times spot turnover on matched timestamps. Neither turnover nor these small, untested correlations establishes causal price leadership or a profitable next-minute forecast.
What holds the two prices together. A perpetual future never expires; instead, every eight hours longs pay shorts a funding rate when the perpetual trades above spot, and shorts pay longs when it trades below. The monthly average basis stays within a few basis points: largest in 2021-02, in the bull market, most negative in 2022-11. Funding is the arbitrage, paid on a schedule; Part thirty-nine builds it.
Pause and predict. With adjustment loadings minus point nine and point one, find the normalized common-trend weights. Then assume equal independent innovation variances and derive B's information share. Why are the two numbers different?
8Market structure: the plumbingIndustry5 min
The models so far had one dealer and one market. An American stock trades on more than a dozen exchanges and dozens of off-exchange venues, linked by rules. The rules decide who meets whom, and at what price.
A historical outline of the 2005 US framework. The order-protection rule restricts trade-throughs of qualifying protected quotations, with exceptions; it does not protect every displayed order or dictate every routing decision. Access rules and fee caps apply within their defined scope. The original sub-penny framework generally used a cent at prices of at least a dollar, subject to exceptions and later amendments. The national best bid and offer is a reference, not a complete measure of execution quality. This lesson does not verify the current legal regime or compliance dates.
Specify the participant. In a conventional maker-taker schedule, a passive fill may receive a rebate. An aggressive fill may pay a separately specified access fee. A maker rebate does not determine that taker fee. A taker round trip crosses the quoted spread and pays both taker fees, as displayed. A maker's bid-to-ask gross revenue instead adds any rebates before adverse selection and inventory costs. Inverted schedules change the fee signs. There is no participant-independent spread-minus-rebate cost formula, and fill probability and queueing remain important.
Where orders go. Exchanges: displayed order books, which set the national best quotes and run the opening and closing auctions. Dark pools: venues with no displayed quotes, usually matching at the midpoint, where a large order can hide, which is Kyle's insider's wish. And wholesalers, who buy retail orders from brokers and fill them themselves, often slightly better than the best quote. Together, off-exchange trading has been around half of American equity volume, as reported.
Who chooses the dark? A dark pool matches buyers and sellers at the midpoint, saving the spread, but only if the other side shows up. Haoxiang Zhu showed that informed traders all want the same side, so their dark orders often go unmatched, and they prefer the lit market's certain fill. So the dark attracts the uninformed, which concentrates information on the exchanges: discovery can improve even as the public spread widens.
Chapter two explains the consequences. Retail orders are less likely to be informed, so a wholesaler can fill them inside the spread and still profit. What remains on the exchanges is richer in information. And by Glosten and Milgrom, a larger share of informed traders means a wider public spread for everyone left. Segmentation helps the segment that leaves and can hurt the price everyone sees: the heart of the debate about payment for order flow.
Two dated design examples. In September 2024 the SEC adopted tick-size and access-fee amendments. Adoption is a historical event; this presentation does not verify subsequent litigation, amendments or current compliance dates. A binding minimum tick can prevent a spread narrowing to its hypothetical competitive level and shift competition toward queue position. That is conditional on the tick binding. IEX introduced a three-hundred-fifty-microsecond speed bump and particular order protections. A delay can reduce some stale-quote exposure; it does not guarantee that every quote is protected or that all latency arbitrage disappears.
Two more pieces of the plumbing. The closing auction: index funds and benchmarked managers want the official closing price, so a large and growing share of each day's volume trades in the final auction. An auction crosses all orders at a single price, a batch auction once a day, the design Chapter ten proposes for every moment. And order types, from market to pegged to hidden, each a statement of how much immediacy the trader wants to buy or to sell.
After execution comes settlement. US equities moved to standard next-business-day settlement in May 2024, with exceptions for particular instruments and transactions. A shorter exposure window can reduce settlement risk and collateral needs, conditional on netting, volatility and clearing rules; it does not guarantee lower collateral in every case. A centralized crypto venue can credit internal balances immediately, but that is not final on-chain settlement or a withdrawal guarantee. Custody and counterparty risks depend on the venue's legal and operational arrangement.
One retail order's journey. The broker, who owes the customer best execution and may be paid for the order. A router, which splits it across venues by price, fees and the odds of a fill. A wholesaler or dark pool, which fills it inside the best quotes if it can. The lit exchanges, for whatever is left, at the protected quotes. And a day later, settlement through the clearing house. Every arrow is a choice about who the counterparty will be.
Pause and predict. At twenty dollars, quoted full spread is one cent and a hypothetical natural full spread is one third cent. A maker earns point two cent rebate. What can be said about taker cost without its fee? Then stipulate a separate point two cent taker fee and compute one-way cost in basis points.
9High-frequency traders as market makersIndustry3 min
The dealers of Chapter one are now algorithms, quoting thousands of instruments and updating in microseconds. Are they the market makers of today, or something else? The evidence says both, depending on the moment.
The new market makers. Albert Menkveld studied one high-frequency market maker in European stocks: most of its trades were passive, at its own quotes. Its inventory reverted to zero fast, and ended each day near flat: Chapter one's shading, automated. It earned the spread, less what better-informed traders took, and its speed is what kept those losses small: timely updating can reduce stale-quote exposure, subject to latency and execution risk.
The evidence. Terrence Hendershott, Charles Jones and Albert Menkveld: when the New York Stock Exchange automated its quotes in 2003, algorithmic trading rose and spreads in large stocks narrowed. Jonathan Brogaard, Hendershott and Ryan Riordan: high-frequency traders' aggressive orders moved in the direction of permanent price changes, speeding up price discovery. And the same orders take liquidity from slower quotes when news arrives: part of their profit is other market makers' adverse selection.
A model of stale-quote races. Public information can change fair value before all quotes update; one participant cancels while others try to execute. Relative latency and the venue's rules determine which message succeeds. One-against-many reasoning does not by itself supply a universal loss probability. Under competitive risk-neutral quoting, expected losses conditional on execution contribute to the required half-spread. A common speed improvement need not eliminate relative-speed rents in the model, but actual costs depend on market design and behavior. Chapter ten considers a batch mechanism under explicit assumptions.
And a subtler kind of speed. A pension fund slicing a large order leaves a pattern in the flow. Liyan Yang and Haoxiang Zhu modelled back-runners: fast traders who detect the pattern and trade the same way, raising the institution's cost while moving the price toward its information sooner. So execution algorithms add randomness and hide size in dark pools: Kyle's insider, playing against an opponent who reads the flow.
Is the sniping cost large? Matteo Aquilina, Eric Budish and Peter O'Neill used the London Stock Exchange's message data, including the failed attempts to cancel, to find races between fast traders to the same stale quote, settled in microseconds. They reported races in about a fifth of FTSE one hundred trading volume, and a tax on liquidity of about half a basis point on all trading. Paid by investors through the spread, and won by a handful of the fastest firms.
And the abuses speed allows. Momentum ignition: aggressive orders meant to start a move that other algorithms follow, then trading against it. Spoofing and layering, Part thirty-four's cases. And floods of orders and cancels that slow others' data. Every one exploits other algorithms reading the order book, which is why surveillance reads it too.
Pause and predict. In a chosen per-fill model, two percent of executions impose a three-tick adverse loss, and every fill earns half the spread. Find the break-even full spread before other costs. Explain why unconditional news frequency is insufficient.
10When liquidity vanishesIndustry4 min
Quoted liquidity can change sharply during stress. We consider the dated 2010 equity flash crash and 2014 Treasury episode, then descriptive Bitcoin slopes. Reported mechanisms and observed associations must be separated from a universal causal explanation. Dealer withdrawal and shallow depth are risks, not facts established by turnover alone.
The sixth of May, 2010. On an already nervous afternoon, a large fund complex began selling seventy-five thousand E-mini futures contracts, about four billion dollars, with an algorithm told to trade nine percent of the volume, whatever the price, as the regulators' joint report described. The E-mini fell about five percent in minutes; stocks followed, some trading at a cent; and most of the fall reversed within about twenty minutes.
The reports describe interacting mechanisms. A volume-targeting program can accelerate when measured turnover rises. If its own trading contributes, the volume clock is endogenous; that does not create independent liquidity. Kirilenko and coauthors describe high-frequency intermediaries passing inventory rapidly and changing their demand during the episode. This is evidence about a dated event, not proof that one class of traders universally causes or prevents crashes. Thinner books and distant placeholder quotes amplified some executions. Causality involves market conditions, other participants and the order design together.
What changed after. Price bands on single stocks that pause trading when a price moves too far too fast. Rules to cancel trades far from the market. And the lesson for anyone relying on liquidity: it is a choice dealers make every microsecond, plentiful when it is least needed and withdrawn when inventory risk spikes.
Daily same-bar regression slopes in the saved archive. The median is 5.3 basis points per million dollars. Every finite saved slope appears without percentile clipping. The largest selected slope is 3.5 times the median. Its correlation with daily volatility is 0.31, and with dollar turnover -0.00. The highlighted dates were ranked after observing the sample. These descriptive associations do not identify vanished executable depth, a liquidation mechanism or a forecast available before stress. Daily gaps and omitted costs remain.
A stipulated feedback model, not a calibration. Margin rules can trigger forced selling after a price decline, with venue-specific liquidation design. Suppose a causal local impact coefficient converts incremental sales into price changes, and L gives incremental forced sales per basis point. Their product above one indicates local linear amplification in this simplified model. It is neither a necessary-and-sufficient condition for a real crash nor established by the contemporaneous OLS slope. Nonlinear books, inventory constraints, other buyers, halts and changing rules can alter the dynamics.
And bonds. On the fifteenth of October 2014, in the most liquid bond market in the world, the ten-year Treasury yield fell about sixteen basis points and came back within roughly twelve minutes, with no news to explain it. The official report found that high-frequency firms dominated the trading, and that the order books had thinned before the move. A market can be deep in volume and shallow in commitment.
Chapter nine's remedy. Today, orders are matched the instant they arrive, so a tiny speed advantage wins every race. Budish, Cramton and Shim propose frequent batch auctions: collect orders for a fraction of a second, then clear them all at one price. Within a batch, arriving first is worth nothing, so would-be snipers must compete on price, and the rent from public news flows back to the quote's owner, and through narrower spreads to investors.
A deliberately simple per-execution example. A risk-neutral competitive maker earns half-spread per fill before other costs. Assume each fill has adverse loss three ticks with probability point zero two, independent of the quoted spread in this calculation. Expected adverse loss is point zero six tick, requiring full spread point one two tick before inventory and processing costs. Unconditional news frequency would not be the same probability. An ideal batch design can reduce this particular stale-quote rent if makers can revise within the batch and compete on price. Batch boundaries and other information or inventory costs remain; no universal zero-loss guarantee follows.
Pause and predict. Sell five percent of ADV at nine percent of a specified exogenous volume clock, one ADV per day. Find the time. What changes if independent liquidity doubles, and why does turnover generated by the order itself not justify the same capacity conclusion?
11Rule 35: know who is on the other sideIndustry4 min
The House's thirty-fifth rule is about the counterparty. Before any desk trades in a market, it must know who it is likely to be trading with, and what its own orders will tell them.
The sheet records nine verified ordinary outputs and an explicit missing comparison. Inventory shading is a stipulated simulation; GM's crossing index is conditional and capped; continuous Kyle is approximated on a finite grid. Bitcoin flow slopes and fit statistics are descriptive. The ETF comparison is unavailable after frozen SPY validation failed. VPIN's two correlations compare different imbalance constructions, and information shares are model-dependent attribution ranges. This sheet neither identifies counterparties' private information nor approves a live trading system.
Separate a fit from an execution model. Ten million dollars times the saved regression slope gives 46.1 basis points of fitted same-bar return. It is not an estimate of an added order's causal cost. Separately stipulate permanent linear impact as quantity accumulates, with no spread, fees, outside flow or decay. Integrating that assumed price path gives average shortfall lambda Q over two, half its terminal change. A concave minute-bin plot does not calibrate this path, prove cheaper slicing or determine the House's footprint.
Chapter two's quotes in four lines. The probability of a buy when the value is high, and when it is low; Bayes' rule for the value given a buy, and given a sell; and the quotes are the expected values. Nothing in it knows about profit: zero profit is built into the definition.
The exact regression source drops nonfinite paired observations, includes an intercept and computes a classical iid residual-based t-statistic and same-sample R squared. Dropping observations does not restore missing calendar minutes. This routine estimates an association; it supplies no robust standard errors, causal identification, parent-order cost or public-information variance decomposition.
The exact information-share code uses the complement of the fitted adjustment loadings and two Cholesky orderings of residual covariance. These give attribution bounds within a specified stable two-market cointegration model. The range is not a confidence interval, and a true causal share is not guaranteed to lie inside it when the statistical or structural assumptions fail.
The unchanged Euler source approximates the bridge. Each step applies remaining-gap drift plus fresh independent noise. At the final step the old gap cancels but the new noise remains. Thus the last price differs from value by lambda sigma u square root of the time step times a standard Normal draw. The continuous theorem has exact endpoint learning; this finite-step helper does not. The code and financial algorithm are preserved, and the presentation states its numerical limit.
The library provides research tools. Dealer and Kyle models, liquidity proxies, bulk classification and information-share estimators have different assumptions. Public taker volume records trade side, not informed identity. Proposed Rule thirty-five asks a desk to document those distinctions, identify execution costs with suitable evidence and review its orders in context. The lesson does not establish deployed surveillance, counterparty identification or a trading approval. Failed input validation remains visible rather than being filled by an unverified result.
Three review questions. For a daily spread paper, inspect identification assumptions and seek actual aligned quotes, rather than equating a tick with an effective spread. For a toxicity vendor, compare like-for-like bucket statistics and test inputs available at the decision time; correlation with volatility does not measure informed probability. For a large proposed order, require a causal cost model, fills, fees, participation constraints and information risk. A regression slope and a concave plot alone do not prescribe slicing.
For the researcher: Kyle in continuous timePhD8 min
For the researcher. Chapter three's recursion suggested a limit: as the auctions multiply, the price impact settles and the remaining uncertainty falls in a straight line. This chapter proves the limit in continuous time, following Kyle's 1985 paper and Kerry Back's 1992 proof, and checks it.
State the equilibrium problem precisely. Gaussian value has public prior mean p zero and positive variance; it is independent of the noise Brownian motion, and only the insider initially observes it. Noise variance per unit time is sigma u squared. The risk-neutral insider uses a predictable, absolutely continuous order process adapted to value and observed noise or prices, never future noise. Competitive risk-neutral dealers condition only on total flow. Profit is the time integral of mispricing times trading rate. Admissibility must make that profit integrable, the verification stochastic integral mean zero and the terminal limit justified. These are essential conditions, not consequences of a formal maximization.
Filtering within the linear Gaussian candidate. Take a deterministic locally regular trading coefficient beta times the remaining mispricing, on times strictly before the terminal horizon. The dealer's innovations process yields gain beta times posterior variance over noise variance, and price changes equal that gain times total flow. The Riccati equation makes posterior variance decline at gain squared times noise variance. This is conditional on the specified information structure and candidate strategy; it is not a filtering theorem for arbitrary real signed flow.
Fix a positive constant price slope for the deviation problem. Consider this quadratic verification potential, conditional on the insider's known value. Its derivatives cancel the trading-rate term in the formal HJB expression. At time one it is squared mispricing over twice lambda, a nonnegative penalty. It is not the literal terminal value function for arbitrary price: there is no trading time left then. The useful result is an upper bound on admissible expected profit, attained when this penalty vanishes. We prove that bound with Ito's identity.
Verification replaces a purely formal HJB claim. Apply Ito under the fixed constant-slope price rule. The potential's drift is minus the profit rate, and its noise term is minus sigma u times the gap. Integrate. Require finite expected integrated squared gap, integrable absolute profit and terminal convergence sufficient to pass expectations. The stochastic integral is square-integrable and has mean zero. Alternatively, localization needs justified limits, not just stopped identities. Expected profit equals initial potential minus nonnegative terminal penalty, hence is bounded above. Endpoint learning attains that bound within the admissible class. Pointwise cancellation alone proves neither admissibility nor optimality for an arbitrary rate.
Close the equilibrium loop. Seek an admissible strategy with endpoint learning and a constant positive slope. The Gaussian filter then requires initial variance minus lambda squared sigma u squared to be zero at time one. Thus lambda is sigma v over sigma u. Beta equals one over lambda times remaining time. Its filtered variance is sigma v squared times remaining time, consistently giving the same gain. The bridge has finite expected integrated squared gap and finite expected absolute profit; its terminal gap converges in mean square to zero. These checks both validate pricing and attain the insider's upper bound. They hold despite a divergent integral of the squared trading rate.
The specified Gaussian equilibrium. Positive lambda is sigma v over sigma u; the trading rate is the remaining gap divided by lambda times remaining time. Conditional variance falls linearly to zero. Average the attained initial bound over the Gaussian value to obtain sigma v sigma u. That doubles one-auction profit only at the same horizon and total noise variance. To the market, price is a martingale with diffusion coefficient sigma v; conditional on value, it is a Brownian bridge. Linear variance decline does not mean constant Shannon-information release, which accelerates as remaining variance vanishes.
The filtration changes the description. Under the equilibrium prior mixture, total flow is sigma u times a Brownian motion in the market filtration, and price is a martingale there. The insider also knows the terminal value, so the same path has bridge drift pulling it toward that endpoint. These are consistent descriptions of one Gaussian equilibrium. The noise-like marginal flow law does not mean the insider does nothing, nor does it let an observer identify private information in real data. Constant impact was verified jointly with strategy and filtering.
Four saved Euler paths with four hundred steps. They approximate the Gaussian bridge; the dots mark their true values. At the last Euler step the drift removes the prior gap, but a fresh noise increment remains. The final price equals value plus lambda sigma u times the square root of the step times a standard Normal draw. These finite-grid paths therefore do not end exactly on their dots. Exact endpoint learning is a continuous-time limit, not an identity of this numerical scheme.
Six hundred saved simulated markets. The plotted mean squared gaps can be compared with one minus time. The sample mean has Monte Carlo error, and the Euler scheme has discretization error, including a nonzero final-step gap. Its average profit is 0.989, compared with theory 1. The original numerical profit prices each increment at its post-step price. It is an approximation, without a provided numerical error bound or confidence interval. This supports an illustration; the verification argument establishes the theorem.
The saved discrete recursion. As auction count increases, initial impact approaches one and terminal conditional variance becomes smaller. The column at half-time uses interpolation between saved variance points; for one auction its interpolated value is not an additional mid-auction observation. The unit horizon and total noise variance are held fixed. These selected numerical cases illustrate convergence; a table alone is not a convergence proof or a bound on approximation error.
The singular rate needs care. Beta diverges near the endpoint, while mispricing shrinks. The displayed expectation is of squared trading rate: sigma u squared over remaining time. Its integral diverges, so requiring globally square-integrable rate would exclude this equilibrium. Expected absolute rate instead grows as inverse square root of remaining time and is integrable. The integrated squared gap and absolute profit satisfy the verification requirements. For horizon T with fixed noise variance rate, lambda is sigma v over sigma u square root T, and expected profit is sigma v sigma u square root T. If total noise variance were held fixed instead, that horizon comparison would change.
Match both normalization and execution convention. One auction over a unit horizon with noise variance sigma u squared leaves half the value variance unrevealed. The admissible continuous Gaussian equilibrium at the same total noise variance reaches zero posterior variance and doubles expected insider profit. Noise losses equal that gain under the compatible post-trade discrete-auction limit and competitive zero-profit accounting. A naive pre-trade Ito integral is a different execution convention and cannot be substituted silently. This is an equilibrium accounting comparison, not the payoff from accelerating an arbitrary real trader.
A model-data distinction. Under the exact constant-slope model, price increments equal lambda times total-flow increments. An aligned regression of those same objects would fit perfectly. Our Bitcoin regression instead uses log returns between closes and an approximate dollar imbalance from minute bars, with R squared 0.21 at one row and 0.32 at sixty rows. Their residuals do not measure the share of public information. Transaction noise, missing bars, timing, nonlinear relationships and omitted variables also matter. This comparison identifies neither public-news variance nor the fraction learned through private trading.
Related models require their own hypotheses. Back's continuous-time work treats more general value distributions; the quadratic potential and literal Gaussian price bridge here should not be copied unchanged to that setting. Holden and Subrahmanyam study competition among informed traders, changing how quickly information is revealed. Back and Baruch connect strategic sequential-trade and continuous-flow models under particular limits. Frequent small binary-value trades alone do not establish every claimed equivalence.
Three extension questions, without claiming the literature has no answers. How do specified public signals interact with private learning? A regression residual alone does not calibrate that split. How do strategic liquidity traders change the noise process? Preferences, deadlines and observations matter. How does venue choice change execution and information revelation? These questions have existing research; any new contribution needs a precise scope and comparison with it.
Pause and predict. Prior value standard deviation is two, and noise diffusion is one unit per square-root year. Compare one- and four-year horizons, holding that noise variance rate fixed. Derive lambda, the price diffusion coefficient and expected profit. Check the time and quantity units.
Recap, desk questions, problemsAll tracks5 min
Part thirty-five's distinctions. Inventory control is illustrated by a specified heuristic, not a universal ruin theorem. Glosten and Milgrom derive conditional zero-profit quotes; Gaussian Kyle derives a strategic equilibrium. Daily-price liquidity proxies have assumptions, and our planned ETF comparison is unavailable. Bitcoin's saved slopes describe same-bar association. VPIN's comparator uses different bucket aggregation. Hasbrouck's wide ranges describe model-dependent attribution, not a causal leadership verdict.
Market rules and venue design change which orders meet, but dated descriptions are not current legal guidance. High-frequency trading includes liquidity provision and stale-quote strategies; historical stress episodes involve interacting mechanisms. Batch auctions alter some speed incentives under their design assumptions. Proposed Rule thirty-five documents measurement and execution evidence. The continuous Gaussian theorem requires verified pricing, admissible trading and matched noise normalization; the finite Euler paths retain endpoint error.
Six desk questions. Why is there a spread when dealers are competitive and risk-neutral? Adverse selection. What is Kyle's lambda? The price of a unit of flow. Why does a dealer shade its quotes? To unwind its inventory.
When is a daily spread estimate credible? Check constant-spread, efficient-price and trade-sign assumptions, then compare with aligned quote evidence. What does VPIN measure? Its constructed bulk-classified mean absolute bucket imbalance, not an identified informed probability. What do stress reports establish? Dated evidence about interacting mechanisms, rather than a universal single cause. The notes state the mathematical assumptions separately.
The first answers. The heuristic mid is two below value, with bid minus two point five and ask minus one point five. After a buy the belief is point seven; the next bid is 0.50, ask 0.845. Doubling noise variance multiplies its standard deviation by square root two, scales one-auction lambda down by that factor, and scales the fixed-gap order and unconditional expected profit up by it.
Roll gives 0.04 dollars under its identity. A negative sample covariance does not establish all its assumptions. The fitted flow change is forty-six basis points. Only under a separate permanent-linear path does average execution shortfall equal twenty-three, with no spread or fees. Bulk classification assigns 977.25 Bitcoin to buys and 22.75 to sells, even if recorded taker volumes are balanced. This cannot identify informed probability.
The adjustment vector gives common-trend weights point one and point nine. With equal independent innovations B's information share is point nine eight seven eight, a different object. At twenty dollars the quoted half-spread is two point five basis points. A maker rebate leaves taker fees unknown; separately assuming a point two cent taker fee gives three point five basis points. In the chosen per-fill loss model, point zero two times three ticks is point zero six tick, requiring full spread point one two tick before other costs.
On the specified exogenous volume clock, time is five ninths of a day. Independent external liquidity doubling halves it; turnover generated by the order itself does not prove doubled capacity. In continuous Gaussian Kyle, prior value spread two and noise diffusion one give lambda two, price diffusion two and expected profit two over one year. With the same noise variance rate over four years, lambda and price diffusion become one, while expected profit becomes four. These are model quantities with a fixed information and admissibility structure.
Six basic problems state their models: quote shading, binary Bayesian quotes, one-auction noise scaling, the Roll identity, a fitted flow change against a separately assumed execution path, and bulk-volume classification. Derive the quantities with units and distinguish estimation from identification. Full English and Chinese solutions are in the notes.
Four advanced problems distinguish common-trend weights from information shares, maker rebates from taker costs, per-fill adverse losses from news frequency, and exogenous liquidity clocks from own-generated turnover. Every numerical answer needs its stated denominator and model assumptions.
Two qualifying problems prove the Ito profit identity with admissibility and terminal limits, then derive one-auction equilibrium and verify continuous Gaussian pricing with horizon units. The quadratic terminal penalty is not arbitrary terminal value. Formal HJB cancellation alone is insufficient. Match total noise variance before comparing profits.
The next subjects separate related problems. Part thirty-six studies order-book queues, ticks and fills. Part thirty-seven studies execution schedules under specified objectives, costs and constraints, which need not equal the informed Kyle strategy. Part thirty-eight combines inventory and adverse selection in market making. Part thirty-nine studies digital-asset venues and derivatives.
The textbooks and cited papers provide theory and dated empirical accounts. Current calculations use nine verified unchanged ordinary outputs from stipulated simulations and Binance's frozen public archive. The planned Yahoo comparison failed frozen SPY validation and is omitted. Chosen arithmetic is labeled as such. Not every attributed historical claim is computed by this code, and current legal outcomes and production pronunciation are not certified by these visual checks.
The House now has a research framework for asking who may be on the other side, what is actually observed and what assumptions support a measurement. It has not identified each trader's private information or established a deployed execution or surveillance system. Next, Part thirty-six: order-book queues, minimum ticks and the probability of a resting fill before prices change.
Where it goes next. The next part opens the book itself: queues, order flow and the microprice.
Key results
The part's results in one place, for revision.
Try it
Lab 35 · Why there is a spread: Glosten-Milgrom and Kyle
A dealer cannot tell informed traders from noise. Compute the zero-profit bid and ask as the informed share grows, watch the dealer's belief converge on the truth trade by trade, then run Kyle's insider in continuous time and check that prices reveal the value exactly at the end.
python -m videos.quant.labs 35
needs numpy, scipy, matplotlib, numba · download lab35.py ·
source on GitHubInformed share 10% bid 0.450, ask 0.550: spread 0.100
Informed share 30% bid 0.350, ask 0.650: spread 0.300
Informed share 50% bid 0.250, ask 0.750: spread 0.500
Belief passes 99% after 34 trades (30% informed, true value high)
Kyle, one auction lambda 0.50, insider profit 0.50, variance revealed 50%
Kyle, continuous: |final price - value| 0.008 0.010 0.035
The spread is what uninformed traders pay so the dealer breaks even against informed ones. Order flow moves prices because it might be informed.
The code (54 lines; it asserts its own result)
"""Lab 35: the spread as insurance against the informed, and prices that learn from orders."""
import numpy as np
from videos.quant import labs
from explainer.quant.house import micro
TITLE = "Why there is a spread: Glosten-Milgrom and Kyle"
GOAL = ("A dealer cannot tell informed traders from noise. Compute the zero-profit bid and ask as the informed "
"share grows, watch the dealer's belief converge on the truth trade by trade, then run Kyle's insider "
"in continuous time and check that prices reveal the value exactly at the end.")
TASKS = [
"Start the dealer's prior at 0.9 instead of 0.5. Where is the spread widest, and why?",
"In micro.kyle_one, double the noise traders' volume. What happens to lambda and to the insider's profit?",
"Estimate Roll's spread (micro.roll_spread) from the simulated trade prices. Why is it below the quoted one?",
]
def run(seed=0):
lab = labs.Lab()
mus = np.linspace(0.0, 0.9, 46)
spreads = np.array([np.subtract(*micro.gm_quotes(0.5, m)) for m in mus])
for m in (0.1, 0.3, 0.5):
ask, bid = micro.gm_quotes(0.5, m)
lab.row(f"Informed share {m:.0%}", f"bid {bid:.3f}, ask {ask:.3f}: spread {ask - bid:.3f}")
assert abs((ask - bid) - m) < 1e-9, "at a prior of one half the spread equals the informed share"
run_ = micro.gm_simulate(0.3, 200, v_true=1.0, p0=0.5, seed=seed)
half_life = int(np.argmax(run_["p"] > 0.99))
lab.row("Belief passes 99% after", f"{half_life} trades (30% informed, true value high)")
k1 = micro.kyle_one(sigma_v=1.0, sigma_u=1.0)
lab.row("Kyle, one auction", f"lambda {k1['lambda']:.2f}, insider profit {k1['profit']:.2f}, variance revealed "
f"{100 * (1 - k1['post_var']):.0f}%")
ends = [micro.kyle_continuous(v, 0.0, 1.0, 1.0, n=2000, seed=seed + i) for i, v in enumerate((1.2, -0.7, 0.4))]
gaps = [abs(e["p"][-1] - v) for e, v in zip(ends, (1.2, -0.7, 0.4))]
lab.row("Kyle, continuous: |final price - value|", " ".join(f"{g:.3f}" for g in gaps))
lab.note = ("The spread is what uninformed traders pay so the dealer breaks even against informed ones. "
"Order flow moves prices because it might be informed.")
assert run_["p"][-1] > 0.99 and max(gaps) < 0.08 and np.all(np.diff(spreads) >= -1e-12)
fig, ax = labs.figure(3, size=(12, 3.9))
ax[0].plot(100 * mus, spreads, color=labs.P)
ax[0].set(title="Zero-profit spread", xlabel="informed traders, %", ylabel="ask - bid (value is 0 or 1)")
n = np.arange(len(run_["p"]))
ax[1].fill_between(n[:120], run_["bid"][:120], run_["ask"][:120], color=labs.SPOT, alpha=0.3, label="bid to ask")
ax[1].plot(n[:120], run_["p"][:120], color=labs.SPOT, label="dealer's belief")
ax[1].axhline(1.0, color=labs.GAIN, ls="--", lw=1)
ax[1].set(title="Learning from the tape", xlabel="trade")
ax[1].legend(fontsize=8)
for e, v, c in zip(ends, (1.2, -0.7, 0.4), (labs.GAIN, labs.LOSS, labs.P)):
ax[2].plot(e["t"], e["p"], color=c, lw=0.9)
ax[2].plot(1.0, v, "o", color=c)
ax[2].set(title="Kyle: the price is a bridge to the value", xlabel="time")
lab.fig = fig
return lab
Now change it
- Start the dealer's prior at 0.9 instead of 0.5. Where is the spread widest, and why?
- In micro.kyle_one, double the noise traders' volume. What happens to lambda and to the insider's profit?
- Estimate Roll's spread (micro.roll_spread) from the simulated trade prices. Why is it below the quoted one?
Problems, with solutions
Try each problem before opening its solution; the last two of each set are at qualifying-exam level.
Twelve worked problems: six basic, four advanced, two qualifying
All inputs below are explicit mathematical models. No problem restores a failed source, runs a market backtest or calibrates a firm.
Basic 1 — Quote shading
(basic 1) Quote heuristic: q=40, gamma=0.05, full spread 1. Derive bid and ask relative to fair value.
Solution
Take mid (v-\gamma q), bid/ask mid (\mp s/2), inventory (q=40), shading coefficient (\gamma=0.05), full spread (s=1). The mid is (v-2), so bid (v-2.5), ask (v-1.5). Lowering both quotes encourages inventory reduction in the specified arrival model. This arithmetic establishes neither optimality nor survival for an arbitrary dealer.
Basic 2 — One buy in Glosten–Milgrom
(basic 2) Binary GM model: prior 0.5 and informed share 0.4. After a buy, derive the posterior and next bid/ask.
Solution
Values are 0 and 1, prior (p=1/2), informed-arrival share (\mu=0.4), and independent noise traders buy/sell equally. Thus (P(B\mid V=1)=0.7), (P(B\mid V=0)=0.3). Bayes gives posterior (p'=0.7); the executed ask was 0.7. For the next trader,
[ a'={0.7\cdot0.7\over0.7\cdot0.7+0.3\cdot0.3}={49\over58}=0.8448276, \qquad b'={0.7\cdot0.3\over0.7\cdot0.3+0.3\cdot0.7}=0.5. ]
These are competitive conditional zero-profit quotes, not unconditional estimates of a real informed share.
Basic 3 — More noise in one-auction Kyle
(basic 3) One-auction Gaussian Kyle: double noise variance at fixed value variance. Compare lambda, order and expected profit.
Solution
With fixed positive value variance and independent Gaussian noise, equilibrium has (\lambda=\sigma_v/(2\sigma_u)), (\beta=\sigma_u/\sigma_v), (x=\beta(v-p_0)), and (E\pi=\sigma_v\sigma_u/2). Doubling noise variance replaces (\sigma_u) by (\sqrt2\sigma_u). Hence (\lambda' =\lambda/\sqrt2), (\beta'=\sqrt2\beta), fixed-gap order (x'=\sqrt2x), and (E\pi'=\sqrt2E\pi). This compares equilibria; deviations against a fixed pricing rule are a separate problem.
Basic 4 — Roll's identity
(basic 4) Roll covariance -0.0004 dollars squared: compute the full spread and state the identification assumptions.
Solution
For lag-one covariance (-0.0004) dollars squared, the estimated full spread is (2\sqrt{0.0004}=\mathbf{0.04}) dollars. The square root restores dollar units. Identification requires constant spread and a price decomposition with independent suitable trade signs and independent efficient-price innovations. Reversal, correlated signs and sampling noise can contaminate the estimate; a negative sample covariance alone does not establish the assumptions. Nonnegative covariance leaves this real-valued formula undefined.
Basic 5 — Fitted change versus execution cost
(basic 5) Descriptive flow slope 4.6 bp per million, flow 10 million. Compute fitted change; separately derive average cost on a permanent-linear execution path.
Solution
A descriptive slope (4.6) bp per $1m times observed net flow $10m gives 46 bp fitted same-bar change. It does not identify the causal change from adding a $10m parent order.
Separately stipulate deterministic permanent linear execution impact (p(q)-p_0=\lambda q), with no outside flow, spread, fees, decay or opportunity cost. For quantity (Q), the mean shortfall is (Q^{-1}\int_0^Q\lambda q,dq=\lambda Q/2=\mathbf{23\ bp}), while terminal change is 46 bp. This extra path assumption is not estimated by a same-minute regression or concave minute bins; their shape does not prove real execution is cheaper or prescribe slicing.
Basic 6 — Bulk classification
(basic 6) Bulk classification: +2 standardized-return units, volume 1000 BTC. Compute assigned buys/sells and compare with possible balanced takers.
Solution
For volume 1000 BTC and standardized price change +2, bulk buys are (1000\Phi(2)=\mathbf{977.2499}) BTC; bulk sells are 22.7501 BTC. These are assigned volumes. Recorded taker volumes could be 500/500 because price change does not determine trade side. Neither number is the probability of private information. Comparing average absolute bucket imbalance with absolute imbalance after aggregating buckets changes the estimand: cancellation matters.
Advanced 7 — Trend weights and information shares
(advanced 7) VECM alpha=(-0.9,0.1): derive common-trend weights. With equal independent innovation variances derive B information share.
Solution
Assume a stable two-market VECM with cointegrating vector ((1,-1)) and loadings (\alpha=(-0.9,0.1)). An orthogonal common-trend vector is ((0.1,0.9)), already summing to one. Thus B has common-trend weight 0.9, as it adjusts less to the discrepancy.
Information shares additionally depend on innovation covariance. With equal independent innovation variances, the variance contributions are proportional to (0.1^2) and (0.9^2). B's information share is (0.81/(0.01+0.81)=\mathbf{81/82=0.9878049}). If residuals correlate, Cholesky ordering affects attribution. Weight 0.9 is not information share 0.9, and neither is an unconditional causal leadership claim.
Advanced 8 — Tick and fees
(advanced 8) Price 20 dollars, full spread 1 cent, natural full spread one third cent. Maker rebate 0.2 cent; then separately assume taker fee 0.2 cent. Derive one-way costs in bp.
Solution
At price $20, a one-cent full spread gives half-spread $0.005/$20 × 10,000 = 2.5 bp. A maker rebate of 0.2 cent does not specify the taker fee, so all-in taker cost is initially unidentified.
Now separately stipulate a taker fee of 0.2 cent per share. One-way taker cost relative to the midpoint is 0.5 + 0.2 = 0.7 cent = 3.5 bp. A hypothetical natural full spread of one-third cent has half-spread one-sixth cent = 0.833333 bp. The binding tick alone multiplies half-spread by 3; tick plus the stipulated fee multiplies it by 4.2, not 3. A half-cent tick permits finer quotes but need not produce that spread: competition, costs, queues and fill probability matter. Maker spread revenue adds its rebates before other costs; taker round-trip cost adds its two fees.
Advanced 9 — Per-execution adverse loss
(advanced 9) Competitive per-fill model: adverse probability 0.02 and conditional loss 3 ticks; other costs zero. Derive the break-even full spread.
Solution
In a chosen competitive risk-neutral per-fill model, each execution earns half-spread (s/2) and has adverse loss (J=3) ticks with probability (p=0.02); other costs are zero. Break-even gives (s/2-pJ=0), so expected adverse loss is 0.06 tick and required full spread is 0.12 tick. Tick-size constraints may force a larger feasible quote. Unconditional news frequency alone does not give adverse probability conditional on execution. A batch mechanism reduces this component only under its update, timing and competitive assumptions; other losses can remain.
Advanced 10 — Participation and the volume clock
(advanced 10) Sell 5 percent ADV at 9 percent of exogenous ADV/day. Compare independent volume doubling with own-generated turnover and state the clock.
Solution
Stipulate exogenous tradable volume rate 1 ADV/day and execution rate 9% of that clock, for order 0.05 ADV. Time is (0.05/0.09=\mathbf{5/9}) day. An independent doubling of that rate yields (5/18) day at unchanged participation and other conditions.
Turnover generated by this order is endogenous, so observing double turnover does not establish double outside liquidity. If participation instead means 9% of total volume including the order, and outside rate is (V), solve (q=0.09(V+q)), giving (q=(0.09/0.91)V). The same 0.05 ADV then takes (0.05\cdot0.91/0.09=0.505556) day at outside rate 1 ADV/day. This is a different denominator, not a contradiction or a safe real execution prescription. A feedback response to prints can accelerate without creating external capacity.
Qualifying 11 — Verification, admissibility and the bridge
(qual 11) For fixed positive constant Kyle slope, derive the Ito verification identity and expected-profit bound. Specify admissibility, martingale integrability and terminal limits; verify the Gaussian bridge attains it.
Solution
Fix positive constant (\lambda) and noise diffusion (\sigma_u>0), on ([0,1]). Value (v) is known in the insider filtration and independent of its Brownian noise. Under the fixed price rule (dp=\lambda\theta,dt+\lambda\sigma_u,dW), let (g=v-p) and
[ J(t,p;v)={g^2+\lambda^2\sigma_u^2(1-t)\over2\lambda}. ]
Require predictable locally integrable trading, (E\int_0^1g_t^2dt<\infty), (E\int_0^1|g_t\theta_t|dt<\infty), and terminal convergence allowing the expected potential identity to pass to time 1. These are sufficient conditions for this proof; localization without justified limits is insufficient. The formal HJB rate term (g\theta+J_p\lambda\theta) cancels, and (J_t+J_{pp}\lambda^2\sigma_u^2/2=0). Ito gives the stronger identity
[ dJ=-g\theta,dt-\sigma_u g,dW,\qquad \pi=J_0-J_1-\sigma_u\int_0^1g_t,dW_t. ]
The stochastic integral is square-integrable and mean zero. Since (J_1=g_1^2/(2\lambda)\ge0), (E\pi=EJ_0-EJ_1\le EJ_0). This is a verification bound, not proof that every arbitrary strategy is optimal. (J(1,p)) is a terminal penalty in this argument, not a literal remaining-horizon payoff at arbitrary terminal price. Zero terminal penalty attains the bound only within the admissible class and the fixed price-rule deviation problem.
For the Gaussian candidate take (\lambda=\sigma_v/\sigma_u), (\theta=g/[\lambda(1-t)]). Its solution is
[ p_t=v+(p_0-v)(1-t)+\lambda\sigma_u(1-t)\int_0^t{dW_s\over1-s}. ]
With (v\sim N(p_0,\sigma_v^2)) independent of (W), (Eg_t^2=\sigma_v^2(1-t)). Consequently (E\int g^2dt=\sigma_v^2/2), (E\int|g\theta|dt=\sigma_v^2/\lambda), and (E\int|\theta|dt\le2\sigma_v/\lambda<\infty). The terminal gap converges to zero in mean square; terminal penalties converge in mean, profit in (L^1), and the martingale in (L^2). The bound is attained, yielding (E\pi=\sigma_v\sigma_u).
However (E\theta_t^2=\sigma_u^2/(1-t)), whose integral diverges. Imposing globally square-integrable rate would exclude this equilibrium; it is the integrated squared gap that controls the verification martingale. Pricing consistency is a further equilibrium requirement, proved in Problem 12. The preserved Euler scheme has last-step error (p_N-v=\lambda\sigma_u\sqrt{\Delta t},Z), so finite-step endpoint learning is not exact.
Qualifying 12 — Equilibrium and horizon units
(qual 12) Derive one-auction Gaussian equilibrium and expected noise loss. Verify filtering in the continuous equilibrium and horizon T scaling at fixed noise variance rate; compare equal total noise variance.
Solution
One auction: independent (v-p_0\sim N(0,\sigma_v^2)), (u\sim N(0,\sigma_u^2)); insider chooses (x=\beta(v-p_0)) before seeing noise; competitive risk-neutral dealers price (p=p_0+\lambda(x+u)). At fixed (\lambda>0), conditional profit is ((v-p_0)x-\lambda x^2); its maximizer gives (\beta=1/(2\lambda)). Gaussian conditional expectation gives
[ \lambda={\beta\sigma_v^2\over\beta^2\sigma_v^2+\sigma_u^2}. ]
Combining yields (\beta=\sigma_u/\sigma_v), (\lambda=\sigma_v/(2\sigma_u)), (E\pi=\sigma_v\sigma_u/2). Expected noise loss at that post-auction price is (E[(p-v)u]=\lambda\sigma_u^2=\sigma_v\sigma_u/2). Dealers break even unconditionally; posterior variance is (\sigma_v^2/2).
For continuous horizon (T>0), noise diffusion (\sigma_u) has quantity per square-root-time units. Take (\lambda=\sigma_v/(\sigma_u\sqrt T)), (\beta_t=1/[\lambda(T-t)]), (\Sigma_t=\sigma_v^2(1-t/T)). Then Gaussian filtering gain (\beta_t\Sigma_t/\sigma_u^2=\lambda), and (\dot\Sigma=-\lambda^2\sigma_u^2=-\sigma_v^2/T). This verifies the candidate conditional-expectation pricing rule, together with the strategy/filtration assumptions. The bridge satisfies the preceding admissibility checks after rescaling time, so expected insider profit is (\sigma_v\sigma_u\sqrt T). Instantaneous price diffusion is (\lambda\sigma_u=\sigma_v/\sqrt T).
Value SD 2 and noise diffusion 1 give ((\lambda,\text{price diffusion},E\pi)=(2,2,2)) at (T=1), versus ((1,1,4)) at (T=4). The one-auction comparison over horizon (T) must use noise-order SD (\sigma_u\sqrt T), giving half the continuous profit. If total noise variance is held fixed when changing (T), profit no longer rises with (\sqrt T). Linear posterior-variance decline gives Gaussian mutual information (\tfrac12\log(T/(T-t))), not constant information release. Any continuous noise-trader profit statement must also specify an execution convention: the post-trade discrete-auction limit differs from a naive Ito integral at pre-trade prices.
Reading and notes
The part's papers
from READING.md
- Demsetz, H. (1968). "The cost of transacting." QJE.
- Garman, M. (1976). "Market microstructure." JFE.
- Ho, T., Stoll, H. (1981). "Optimal dealer pricing under transactions and return uncertainty." JFE.
- Copeland, T., Galai, D. (1983). "Information effects on the bid-ask spread." Journal of Finance.
- Roll, R. (1984). "A simple implicit measure of the effective bid-ask spread in an efficient market." Journal of Finance.
- Glosten, L., Milgrom, P. (1985). "Bid, ask and transaction prices in a specialist market with heterogeneously informed traders." JFE.
- Kyle, A. S. (1985). "Continuous auctions and insider trading." Econometrica.
- Amihud, Y., Mendelson, H. (1986). "Asset pricing and the bid-ask spread." JFE.
- Hasbrouck, J. (1991). "Measuring the information content of stock trades." Journal of Finance; (1995) "One security, many markets: determining the contributions to price discovery." Journal of Finance.
- Lee, C., Ready, M. (1991). "Inferring trade direction from intraday data." Journal of Finance.
- Back, K. (1992). "Insider trading in continuous time." RFS.
- Allen, F., Gale, D. (1992). "Stock-price manipulation." RFS.
- Easley, D., Kiefer, N., O'Hara, M., Paperman, J. (1996). "Liquidity, information, and infrequently traded stocks." Journal of Finance.
- Madhavan, A. (2000). "Market microstructure: a survey." J. Financial Markets.
- Amihud, Y. (2002). "Illiquidity and stock returns: cross-section and time-series effects." J. Financial Markets.
- Biais, B., Glosten, L., Spatt, C. (2005). "Market microstructure: a survey of microfoundations, empirical results, and policy implications." J. Financial Markets.
- CFTC–SEC (2010). Findings Regarding the Market Events of May 6, 2010.
- Hendershott, T., Jones, C., Menkveld, A. (2011). "Does algorithmic trading improve liquidity?" Journal of Finance.
- Comerton-Forde, C., Putniņš, T. (2011). "Measuring closing price manipulation." J. Financial Intermediation.
- Easley, D., López de Prado, M., O'Hara, M. (2012). "Flow toxicity and liquidity in a high-frequency world." RFS.
- Menkveld, A. (2013). "High frequency trading and the new market makers." J. Financial Markets.
- Andersen, T., Bondarenko, O. (2014). "VPIN and the flash crash." J. Financial Markets.
- Brogaard, J., Hendershott, T., Riordan, R. (2014). "High-frequency trading and price discovery." RFS.
- Zhu, H. (2014). "Do dark pools harm price discovery?" RFS.
- Budish, E., Cramton, P., Shim, J. (2015). "The high-frequency trading arms race: frequent batch auctions as a market design response." QJE.
- Comerton-Forde, C., Putniņš, T. (2015). "Dark trading and price discovery." JFE.
- Joint Staff Report (2015). The U.S. Treasury Market on October 15, 2014.
- Menkveld, A. (2016). "The economics of high-frequency trading: taking stock." Annual Review of Financial Economics.
- Kirilenko, A., Kyle, A. S., Samadi, M., Tuzun, T. (2017). "The flash crash: high-frequency trading in an electronic market." Journal of Finance.
- Cartea, Á., Jaimungal, S., Wang, Y. (2020). "Spoofing and price manipulation in order-driven markets." Applied Mathematical Finance.
- Garman, M. (1976). "Market microstructure." JFE. Ho, T., Stoll, H. (1981). "Optimal dealer pricing." JFE.
- Back, K. (1992). "Insider trading in continuous time." RFS. Back, K., Baruch, S. (2004). "Information in securities markets: Kyle meets Glosten and Milgrom." Econometrica.
- Holden, C., Subrahmanyam, A. (1992). "Long-lived private information and imperfect competition." JF.
- Corwin, S., Schultz, P. (2012). "A simple way to estimate bid-ask spreads from daily high and low prices." JF.
- Andersen, T., Bondarenko, O. (2014). "VPIN and the flash crash." JFM. Duarte, J., Young, L. (2009). "Why is PIN priced?" JFE.
- Zhu, H. (2014). "Do dark pools harm price discovery?" RFS. Yang, L., Zhu, H. (2020). "Back-running." RFS.
- Aquilina, M., Budish, E., O'Neill, P. (2022). "Quantifying the high-frequency trading 'arms race'." QJE.
- Collin-Dufresne, P., Fos, V. (2015). "Do prices reveal the presence of informed trading?" JF.
- Hendershott, T., Jones, C., Menkveld, A. (2011). "Does algorithmic trading improve liquidity?" JF.
Data, scope and reproducibilityModels, observations and limits
The fourteen scenes cover dealer inventory; binary Glosten–Milgrom quotes; one-auction and continuous Gaussian Kyle; daily-price liquidity proxies; same-bar flow regressions; PIN and VPIN; two-market information shares; market structure; high-frequency trading; historical liquidity stress; proposed House controls; continuous-time verification; and worked questions.
Nine unchanged ordinary originals succeeded once each: dealer, gm, kyle, flow, vpin, discovery, cross, daily and acf. The unchanged measures original failed once because yahoo/bars/SPY/2015-01-01_2020-12-31 differed from its frozen checksum. Its ten-ETF table, BTC Roll result and Amihud scatter are unavailable and omitted. That key is never retried or refreshed; no replacement historical backtest is introduced. The scenes permit only exact hashes of the nine verified outputs. Sensitive House/envelope/track/holdout prefixes are rejected before cache or counter access.
Public Binance spot/perpetual minute archives cover BTCUSDT in 2021–2024, and five spot coins in 2024. These raw observations are distinct from sealed strategy outcomes. There are no new strategy trials, registrations, registry writes or sealed strategy accesses. Existing counts remain 23,552 through Part 35; 23,562 globally. All 98 protected file hashes remain unchanged.
The audit maps 154 possible immutable public keys before dispatch; it does not assert every possible key was read. Eight earlier rejected keys were carried into a persistent barrier; none overlapped this part's closures. The new SPY rejection is added to that barrier, which blocks every unstarted dependent before invocation.
Scientific distinctions used throughout:
- Inventory diffusion can exit fixed inventory bounds; financial ruin additionally needs wealth and capital assumptions. The simulated shading rule is a heuristic, and terminal across-seed mean/SD is not an annualized Sharpe.
- GM paths condition on true value one and record pretrade beliefs. Their crossing index is capped at 80 for non-hits. A drift-based learning-time calculation is a heuristic, not the same median or an uncensored expectation.
- Close times base-asset taker imbalance approximates dollar flow. Same-bar OLS, selected conditional means, aggregation slopes and cross-coin scaling are descriptive/endogenous. Classical t-statistics are not HAC inference. Missing observations can compress return, aggregation and lag clocks. These outputs identify neither causal parent-order cost nor a public-information variance share.
- Roll needs constant spread, appropriate independent trade signs and efficient-price dynamics. Nonnegative covariance makes its formula undefined, rather than proving zero spread. Corwin–Schultz clips negative estimates in the preserved original. Amihud is an unsigned return-per-dollar proxy, mechanically related to volume. A tick, a quoted spread and an effective spread are distinct.
- VPIN uses full-sample return SD and average volume, so this is ex-post construction. Its mean absolute equal-volume-bucket imbalance differs from the comparator's absolute aggregate taker imbalance over approximate whole-bar windows. Their correlation is not classifier validation or informed probability. Selected crash windows establish neither prediction nor causality. Every finite saved VPIN value and daily stress slope is displayed without clipping.
- Information shares condition on a cointegration/VECM specification and innovation covariance. Cholesky-order ranges are attribution bounds within that model, not confidence intervals or guaranteed causal bounds. Finer timestamps need not resolve all ambiguity. Common-trend weights are not information shares.
- Fee arithmetic specifies maker versus taker, one-way versus round trip, and full versus half spread. A maker rebate does not determine a taker fee. Historical rules and legal accounts remain dated; current proceedings, rules and compliance dates are not verified here.
- Own-generated turnover does not establish independent execution capacity. The cascade condition is local amplification in a stipulated linear feedback model, not a necessary-and-sufficient real-crash test. Batch-auction benefits require their design assumptions.
- The continuous theorem assumes Gaussian value independent of Brownian noise, risk-neutral competitive dealers, a fixed noise clock and admissible insider orders. A quadratic verification potential gives a bound with a nonnegative terminal penalty; formal HJB cancellation alone is insufficient. Posterior variance falls linearly, unlike Shannon information. Euler terminal prices retain fresh noise, and selected simulations have no numerical error bound or Monte Carlo interval.
The proposed Rule 35 is a review requirement, not a deployed surveillance, execution or counterparty-identification system. CPU signal checks and rendered-image inspection cannot certify pronunciation or full continuous production listening.
Companion films in this repository
中文讲义
本讲的中文说明、交易台问题与习题解答(与英文版对应)。
导言第35部分:谁与谁交易
这是四十三部分系列的第35部分,依据教学大纲与阅读表。十四个场景分别讨论库存、Glosten–Milgrom报价、Kyle模型、流动性代理、同期订单流回归、PIN/VPIN、信息份额、市场结构、高频交易、流动性压力、拟议规则、连续时间验证及习题。当前英文旁白约60分钟;双语构建与最终画面审阅仍待实际执行。
九个未经修改的常规原始计算各成功执行一次。measures在首次核对2015—2020年SPY冻结数据时失败,因此十只ETF表、比特币Roll结果与Amihud散点图均未产生并已省略。没有重试失败键、刷新校验和或替代历史回测。只允许加载九个成功输出的精确哈希;House、envelope、track、holdout前缀在查询缓存路径或计数器之前即被拒绝。
154个可能的公开数据键在调用前建立完整依赖映射;这不表示每个键都被读取。八个此前被拒绝的键被继承,本部分没有交集;新SPY拒绝加入共享屏障,阻止所有尚未启动的依赖。公开原始行情不同于封存策略结果。没有新市场试验、注册、登记表写入或封存策略访问。累计计数至第35部分为23,552,全系列为23,562;98个受保护文件不变。
必须区分:库存扩散与财务破产;条件于真实高价值的GM路径与先验混合下的鞅;封顶的交易前信念索引与未删失学习时间;同期回归与因果冲击;最小价格单位、报价价差与有效价差;平均分桶绝对失衡与合并后取绝对值的失衡;共同趋势权重与信息份额;maker返佣与taker费用;独立外部成交能力与自身制造的成交量。缺失时点可能压缩收益、聚合和滞后时钟。完整样本校准的VPIN是事后研究构造,不是已验证的实时信号。选定危机窗口和经典iid t统计量不能提供因果或稳健预测结论。
连续Kyle定理要求高斯价值独立于布朗噪声、风险中性竞争定价、明确的噪声时钟及可容许策略。二次函数是验证上界的势函数,其终值是惩罚;不能凭HJB形式抵消就宣称任意策略最优。后验方差线性下降,不代表香农信息匀速释放。有限Euler路径末步保留新噪声,不会精确到达价值。拟议规则不代表已经部署的交易、监控或对手身份识别系统。历史法规与案例不构成当前法律状态核实;信号检查也不等于完整成片听审或发音认证。
Problems, with worked solutions十二道完整解答:六道基础、四道进阶、两道资格题
以下都是明确给定的数学模型,不恢复失败来源、不拟合公司,也不开展新市场回测。
基础1:库存报价
设中间报价 (v-\gamma q),买卖报价为中间报价减/加半价差。代入 (q=40,\gamma=0.05,s=1),中间报价为 (v-2),买价 (v-2.5),卖价 (v-1.5)。这只是指定线性启发式规则的运算;库存对成交概率的影响取决于到达模型,不能据此证明任意做市商最优或永不破产。
基础2:一次买单后的GM报价
价值为0或1,先验各半,知情交易比例0.4,非知情交易独立等概率买卖。因此高价值时买单概率0.7,低价值时0.3。贝叶斯后验为0.7,该次成交卖价也是0.7。对于下一位交易者,卖价为 (0.7^2/(0.7^2+0.3^2)=49/58=\mathbf{0.8448276}),买价为 (0.7\cdot0.3/(0.7\cdot0.3+0.3\cdot0.7)=\mathbf{0.5})。不要把本次成交价与下一次报价混同。这是模型内条件零利润报价,不是现实知情比例的无条件估计。
基础3:单次Kyle的噪声增加
保持价值方差不变,噪声独立且为高斯分布。均衡有 (\lambda=\sigma_v/(2\sigma_u))、(\beta=\sigma_u/\sigma_v)、(x=\beta(v-p_0))、(E\pi=\sigma_v\sigma_u/2)。噪声方差翻倍使标准差乘 (\sqrt2),所以冲击系数除 (\sqrt2),策略系数、固定价值差下的订单以及无条件期望利润均乘 (\sqrt2)。这是不同均衡的比较;固定价格规则下改变订单属于另一问题。
基础4:Roll价差
若样本一阶自协方差为 (-0.0004) 美元平方,完整价差估计为 (2\sqrt{0.0004}=\mathbf{0.04}) 美元。开平方恢复美元单位。经济识别要求恒定价差、适当独立的成交方向及独立有效价格创新等假设。价格反转、相关订单和采样误差都可能污染估计。负样本协方差不证明模型成立;非负协方差使该实数公式无定义,不证明价差为零。
基础5:拟合变化与执行成本
同期描述性斜率每百万美元4.6基点,乘一千万美元净流量,得到46基点拟合收益变化,不是额外加入一笔母订单的因果成本。
另行假设永久线性执行路径 (p(q)-p_0=\lambda q),忽略外部流量、价差、费用、衰减和机会成本,则平均执行偏离为 (Q^{-1}\int_0^Q\lambda q,dq=\lambda Q/2=\mathbf{23基点}),终点变化仍是46基点。这个路径是新增数学假设,不是分钟回归或凹形分组图估计出来的。后者不能证明现实大单更便宜,也不能推出最优拆单方案。
基础6:批量分类
成交量1000 BTC,标准化价格变化为+2时,分配的买量 (1000\Phi(2)=\mathbf{977.2499}) BTC,卖量22.7501 BTC。实际主动买卖量仍可能各500,因为价格变化不决定成交方向。这些量也不是私有信息概率。先在每个桶内取绝对值再平均,与先合并多个桶再取绝对值不同:相反方向的失衡会在后者抵消。
进阶7:趋势权重与信息份额
在稳定的双市场VECM中,协整向量取 ((1,-1)),调整载荷 (\alpha=(-0.9,0.1))。与其正交且和为1的共同趋势向量为 ((0.1,0.9)),因此B的趋势权重为0.9。
信息份额还依赖创新协方差。若两市场创新等方差且独立,贡献正比于权重平方,所以B的信息份额为 (0.9^2/(0.1^2+0.9^2)=81/82=\mathbf{0.9878049}),不是0.9。创新相关时Cholesky排序影响归属;这些都是模型内统计对象,不是无条件的因果领先判决。
进阶8:最小价格单位与费用
股价20美元,完整报价价差1美分,半价差为0.5美分,即2.5基点。maker得到0.2美分返佣,并不告诉我们taker费用,因此起初不能确定taker全部成本。
另行指定taker每股收费0.2美分,则相对中点的单边成本为0.5+0.2=0.7美分=3.5基点。假设自然完整价差为三分之一美分,其半价差为六分之一美分,即0.833333基点。单独由约束性tick导致的半价差倍数为3;加上指定taker费后倍数为4.2。半美分tick只允许更细报价,不保证实际价差或每位交易者都获益。maker跨买卖价的毛收入加返佣,taker往返成本则加两次费用;还需考虑成交概率、排队、信息与库存损失。
进阶9:按成交条件化的逆向损失
指定风险中性竞争模型:每次成交赚半价差 (s/2),以概率0.02承受3tick逆向损失,其余成本为零。盈亏平衡 (s/2=0.02\cdot3=\mathbf{0.06tick}),所以完整价差0.12tick。实际可报价格还受tick限制。无条件新闻频率不是“给定成交后遭遇逆向损失”的概率。批量竞价只有在及时更新、竞价规则和竞争等假设下才减少这一成分,其他风险不会自动消失。
进阶10:参与率的分母
先规定外生可交易成交量为每天1 ADV,执行率为这个外生时钟的9%,目标0.05 ADV,则用时 (0.05/0.09=\mathbf{5/9天})。若独立外部流动性翻倍,其他条件不变,用时变为5/18天。
自身订单制造的成交量是内生变量,观察到总成交量翻倍不证明外部承接能力翻倍。若把参与率改定义为“含自身订单在内的总成交量的9%”,外部速率为 (V),则需解 (q=0.09(V+q)),得到 (q=0.09V/0.91)。在每天外部1 ADV时,同一订单用时 (0.05\cdot0.91/0.09=\mathbf{0.505556天})。这是不同分母,不是前一答案矛盾,也不是安全执行建议。程序对成交打印的反馈可以加速,而不创造独立流动性。
资格11:验证、可容许性与布朗桥
在单位区间固定正系数 (\lambda,\sigma_u),内部人知道价值 (v),其噪声布朗运动独立于价值;价格规则固定为 (dp=\lambda\theta dt+\lambda\sigma_u dW)。记 (g=v-p),取势函数 (J=[g^2+\lambda^2\sigma_u^2(1-t)]/(2\lambda))。要求交易率可预测且局部可积、(E\int g^2dt<\infty)、(E\int|g\theta|dt<\infty),并要求足以通过终点期望极限的收敛。只写局部化而不证明极限合法是不够的。
形式HJB中 (g\theta+J_p\lambda\theta=0),且 (J_t+J_{pp}\lambda^2\sigma_u^2/2=0)。更有力的是伊藤恒等式 (dJ=-g\theta dt-\sigma_u g,dW),积分后
[ \pi=J_0-J_1-\sigma_u\int_0^1g_t,dW_t. ]
平方可积保证随机积分均值为零。因此 (E\pi=EJ_0-EJ_1\le EJ_0),因为 (J_1=g_1^2/(2\lambda)\ge0)。这是可容许策略的期望利润上界;只有终值惩罚为零且极限成立时才取等号。(J(1,p))不是任意终点价格下还剩交易时间的真实价值函数,形式抵消也不使任意交易率可容许或最优。
取 (\lambda=\sigma_v/\sigma_u)、(\theta=g/[\lambda(1-t)]),桥解为
[ p_t=v+(p_0-v)(1-t)+\lambda\sigma_u(1-t)\int_0^t(1-s)^{-1}dW_s. ]
先验 (v\sim N(p_0,\sigma_v^2)) 且独立于噪声,故 (Eg_t^2=\sigma_v^2(1-t))。于是 (E\int g^2dt=\sigma_v^2/2),(E\int|g\theta|dt=\sigma_v^2/\lambda),且 (E\int|\theta|dt\le2\sigma_v/\lambda<\infty)。终点差均方趋于零;惩罚在均值中、利润在 (L^1) 中、随机积分在 (L^2) 中收敛。上界被达到,无条件期望利润为 (\sigma_v\sigma_u)。
但是 (E\theta_t^2=\sigma_u^2/(1-t)) 的积分发散;若强加整个区间交易率平方可积,就排除了该均衡。验证鞅由“价值差的平方积分”控制,不能与“交易率平方积分”混同。价格是否等于市场条件期望,还需下一题的过滤一致性。原始Euler算法末步保留误差 (p_N-v=\lambda\sigma_u\sqrt{\Delta t}Z),所以有限步数不会精确学习终值。
资格12:均衡与期限单位
单次拍卖中,价值差与噪声订单独立高斯,方差分别 (\sigma_v^2,\sigma_u^2)。内部人先于观察噪声选择 (x=\beta(v-p_0)),风险中性竞争做市商价格为 (p_0+\lambda(x+u))。固定正 (\lambda) 时条件利润为 ((v-p_0)x-\lambda x^2),一阶条件给出 (\beta=1/(2\lambda))。高斯条件期望又给出 (\lambda=\beta\sigma_v^2/(\beta^2\sigma_v^2+\sigma_u^2))。联立得 (\beta=\sigma_u/\sigma_v)、(\lambda=\sigma_v/(2\sigma_u)),内部人期望利润 (\sigma_v\sigma_u/2)。在同一成交后价格下,噪声交易者期望损失 (E[(p-v)u]=\lambda\sigma_u^2=\sigma_v\sigma_u/2),做市商无条件盈亏平衡;后验方差为初始的一半。
连续期限 (T>0) 时,(\sigma_u) 的单位是数量/时间平方根。取 (\lambda=\sigma_v/(\sigma_u\sqrt T))、(\beta_t=1/[\lambda(T-t)])、(\Sigma_t=\sigma_v^2(1-t/T))。代入高斯过滤增益有 (\beta_t\Sigma_t/\sigma_u^2=\lambda),且 (\dot\Sigma=-\lambda^2\sigma_u^2=-\sigma_v^2/T)。结合信息结构与候选策略,这验证市场条件期望定价。桥的可容许性按时间缩放由上一题得到,期望利润为**(\sigma_v\sigma_u\sqrt T),瞬时价格扩散系数为(\lambda\sigma_u=\sigma_v/\sqrt T)**。
价值标准差2、噪声扩散1时,(T=1) 给出 ((\lambda,价格扩散,期望利润)=(2,2,2)),(T=4) 给出 ((1,1,4))。比较同一期限的单次拍卖,必须把噪声订单标准差取成 (\sigma_u\sqrt T),此时利润恰为连续情形的一半。若改变期限时固定总噪声方差,而非固定方差率,利润不再随期限平方根增加。高斯互信息为 (\frac12\log[T/(T-t)]),不是匀速释放。连续噪声交易损益还必须说明执行价格约定;成交后离散拍卖极限不同于直接采用成交前价格的朴素伊藤积分。
Build the film
python -m videos.quant.quant35.compute # the part's numbers, into .cache/quant35
python tools/make.py quant35 # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant35 Hook # one chapter, silent, with a contact sheet
Scenes: videos/quant/quant35. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.