Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guide · Track 07

Market microstructure

Order books and queues, the bid–ask spread and what it pays for, informed trading from Glosten–Milgrom to Kyle, price impact and execution, inventory risk, Avellaneda–Stoikov quoting and market-making P&L.

Your progress0 of 11 read
Up next · Lesson 01Market makers and liquidity

11 lessons, in order

Each builds on the one before

  1. 01Market makers and liquidityWho provides liquidity, how bid and ask quotes work, the spread as the price of immediacy, makers and takers, and the risks a market maker carries.Market MakingUp next
  2. 02The limit order bookLimit and market orders, price–time priority, depth, how a market order walks the book, and slippage measured against the mid price.Order Book
  3. 03Queue position and fill probabilityFirst-in, first-out queues at a price, how long a limit order waits, the chance it fills, why moving it costs priority, and why fills come before price moves.Order Book
  4. 04Adverse selection and informed tradingWhy trading with someone who knows more costs money, markouts as the measure of that cost, toxic flow, and how informed traders change the best spread.Market Making
  5. 05The Glosten–Milgrom modelA Bayesian market maker facing informed and noise traders: quotes as conditional expectations, a spread from the informed share, and learning trade by trade.Glosten–Milgrom
  6. 06Measuring and decomposing the bid–ask spreadQuoted, effective and realised spreads, the Roll estimator from trade prices alone, and the split into adverse selection and the rest.Spread Estimation
  7. 07Informed trading and Kyle's lambdaAn insider hiding among noise traders, a market maker who prices from total order flow, the price-impact coefficient λ, and why the insider trades gradually.Kyle Model
  8. 08Price impact and optimal executionTemporary and permanent impact, the square-root rule of thumb, splitting a large order over time, and the Almgren–Chriss trade-off between cost and risk.Order Book
  9. 09Inventory risk and quote skewingHow a maker's position turns price moves into P&L, why that risk grows with position and time, and how shading both quotes pulls inventory back to zero.Market Making
  10. 10Optimal quoting: the Avellaneda–Stoikov modelExponential utility, fills that fall off with distance from the mid, the reservation price, the optimal spread, and how risk aversion and time shape quotes.Avellaneda–Stoikov
  11. 11Market making profit and loss attributionSplitting a maker's P&L into spread capture, adverse selection, inventory and fees, with markout curves, fill ratios and the numbers a desk watches.Market Making

Check yourself

Questions from the lessons of this series. Open a lesson's group whenever you want to test yourself.

01Market makers and liquidity3 questionsRe-read the lesson
Check yourself

A stock is quoted bid 49.95, ask 50.05. What is the spread in basis points of the mid?

Check yourself

Who pays the spread on a trade?

Check yourself

A maker sells 500 shares at 40.03 and later buys 500 back at 40.07, in USD. What is the result of the round trip?

02The limit order book3 questionsRe-read the lesson
Check yourself

Two buy orders make up the best bid, both at 99.97: 500 shares entered at 09:30:01 and 2,000 shares entered at 09:30:05. A market sell of 600 shares arrives. Who is filled?

Check yourself

The asks are 50.00 for 200 shares and 50.01 for 300 shares. A market buy of 400 shares arrives. What is its average price in USD?

Check yourself

In a book with the same depth at every level, a market buy of size Q walks the book and costs C against the mid, ignoring the spread. Roughly what does a market buy of size 2Q cost?

03Queue position and fill probability3 questionsRe-read the lesson
Check yourself

Two buy limit orders rest at 99.97. Which one fills first when a market sell order arrives?

Check yourself

900 shares are ahead of your order. Sell volume hits the bid at 250 shares per minute and cancellations ahead remove 50 shares per minute. What is the expected wait in minutes?

Check yourself

You cancel a resting buy order and enter it again at the same price. Where does the new order join the queue?

04Adverse selection and informed trading3 questionsRe-read the lesson
Check yourself

The average 10-second markout of a maker's buys is −0.8¢. What does that tell you?

Check yourself

With a zero spread, an informed customer expects the value to move by a normal amount with standard deviation s=2.5s = 2.5s=2.5¢. What is the maker's expected loss on its buy side, in cents?

Check yourself

All customers are noise traders and the fill probability is e−kδe^{-k\delta}e−kδ with k=0.4k = 0.4k=0.4 per cent. Which half-spread, in cents, maximises the maker's income?

05The Glosten–Milgrom model3 questionsRe-read the lesson
Check yourself

The informed share is π=0.5\pi = 0.5π=0.5 and the belief is μ=0.5\mu = 0.5μ=0.5. What is the ask?

Check yourself

Set π=0\pi = 0π=0, so nobody is informed. What happens to the spread?

Check yourself

The informed share rises from π=0.1\pi = 0.1π=0.1 to π=0.3\pi = 0.3π=0.3. Roughly how many times faster does the belief learn, using the gain 2π22\pi^22π2 per trade?

06Measuring and decomposing the bid–ask spread2 questionsRe-read the lesson
Check yourself

The sample covariance of successive price changes is −0.0009 (in USD²). What spread in USD does Roll's estimator give?

Check yourself

Traders become better informed, so the share α of the spread that is information rises. What happens to Roll's estimate?

07Informed trading and Kyle's lambda3 questionsRe-read the lesson
Check yourself

In a one-auction Kyle market σv=2\sigma_v = 2σv​=2 USD and noise trading has standard deviation σu=500\sigma_u = 500σu​=500 shares. What is λ\lambdaλ in USD per share?

Check yourself

The standard deviation of noise trading doubles and nothing else changes. The insider's expected profit…

Check yourself

With one constant λ=0.002\lambda = 0.002λ=0.002 USD per share, three auctions left and a gap V−p=6V - p = 6V−p=6 USD, how many shares does the insider buy in this auction?

08Price impact and optimal execution3 questionsRe-read the lesson
Check yourself

A stock has 1.5% daily volatility. An order is 4% of the average daily volume. With Y=1Y = 1Y=1, what price impact does the square-root rule give, in per cent?

Check yourself

A trader who does not care about risk (λrisk=0\lambda_{\text{risk}} = 0λrisk​=0) faces linear impact. How should the order be split?

Check yourself

The market becomes more volatile while the temporary impact stays the same. How does the optimal schedule change?

09Inventory risk and quote skewing3 questionsRe-read the lesson
Check yourself

A maker is short 1,000 shares. The mid moves with σ=0.01\sigma = 0.01σ=0.01 USD per second\sqrt{\text{second}}second​. What is the standard deviation of the position's P&L over 100 seconds, in USD?

Check yourself

The maker is long and wants to reduce its inventory using only its quotes. It should

Check yourself

A maker is long 2,000 shares. The half-spread is 0.01 USD and the fee is 0.002 USD per share. What does it cost to flatten the position at the bid, in USD?

10Optimal quoting: the Avellaneda–Stoikov model2 questionsRe-read the lesson
Check yourself

A maker is short 4 shares (q=−4q = -4q=−4). The mid is 50, γ=0.2\gamma = 0.2γ=0.2, σ=1\sigma = 1σ=1 and T−t=0.25T - t = 0.25T−t=0.25. What is its reservation price?

Check yourself

At the close (T−t→0T - t \to 0T−t→0), how does a more risk-averse maker's spread compare with a less risk-averse one's?

11Market making profit and loss attribution2 questionsRe-read the lesson
Check yourself

The maker sells 200 shares at 50.03 when the mid price is 50.00. What is the spread capture in USD?

Check yourself

A maker's spread capture is +500 USD a day, but its adverse selection is −650 USD. What is the first thing to try?

About this tool

Narrative guides that connect the interactive tools into a story: financial instruments and their payoffs, the no-arbitrage principle, risk-neutral pricing, delta hedging and the road to the Black–Scholes formula. Each guide links to the labs where you can try the ideas yourself.

Frequently asked questions

In what order should I read the guides?

Start with instruments and no-arbitrage, then risk-neutral pricing and delta hedging; together they lead to the Black–Scholes formula.

Who are the guides for?

Students of financial and insurance mathematics and anyone who wants intuition behind derivatives pricing, not just the formulas.