Finance Lab
Market Maker
Quote bid and ask around a random-walking fair value for 10 rounds, computing Avellaneda-Stoikov reservation prices while informed flow tries to pick you off.
How it works
You pick a stake ($5 to $50 per tick of P&L against a $100 bankroll) and make markets for 10 rounds around a fair value that starts at 100. Each round a hidden truth is generated before you act: with probability 0.35 the flow is informed - it already knows fair value is about to move 2 ticks in its favour - and otherwise it is noise flow with a random 1-tick background move. When a round is informed, there is a 55% chance you are shown a tip (informed BUYING or SELLING likely); otherwise the round reads quiet.
Each round has two checkpoints before your quote goes out. First you compute the Avellaneda-Stoikov reservation price r = fair - q x gamma x sigma^2 x (T - t), with gamma = 1, sigma = 1.5, your current inventory q, and T - t the fraction of the session remaining; you type r and the game checks it to within 0.15 ticks, then reveals the optimal spread delta = gamma sigma^2 (T - t) + (2/gamma) ln(1 + gamma/kappa) with kappa = 1, and sets your half-spread and skew from the model. Second, you answer one quiz question drawn from a bank tied to the live round - expected value per fill or per round, the adverse-selection breakeven, which way to skew on a signal or an inventory position, flatten cost, put-call parity, straddle pricing, or hedging cost.
Then the quote resolves. Wider half-spreads fill less often (fill probability is 1 - 0.2 per tick of half-spread beyond 1, floored at 20%). If filled, a buy-side counterparty lifts your ask at fair + half + skew (you go short one unit) or a seller hits your bid at fair - half + skew (you go long one). Fair value then moves by the round's truth, inventory is marked to market every round, and at the end - or earlier, via the flatten-and-cash-out button - remaining inventory is closed at a cost of 0.5 ticks per unit.
How scoring works
Your P&L in ticks is cash plus inventory marked at fair (cash starts at 0), minus the 0.5-tick-per-unit flatten cost at settlement. Dollar P&L is ticks times your chosen stake, the session banner shows profit or loss against the $100 bankroll, and the leaderboard records your dollar P&L rounded to the nearest dollar - profit, not final bankroll.
The reservation-price and quiz answers gate the round's flow (you must answer to proceed) but are checked for learning; the game's P&L comes from the quotes themselves.
Adverse selection sets the floor under your spread
Every fill is a trade against someone who chose to trade with you, and 35% of the time that someone knows the price is about to move 2 ticks their way. Your expected P&L per fill is half-spread + skew - P(informed) x informed move = half + skew - 0.7 ticks. So 0.7 ticks is the breakeven half-spread against informed flow alone: quote tighter with no skew and each fill loses money on average.
This is the Glosten-Milgrom insight in miniature - the bid-ask spread is not greed, it is the insurance premium a market maker charges for trading with potentially better-informed counterparties. The noise trades at your spread pay for the informed trades that run you over, and the spread must be wide enough for the arithmetic to net positive.
There is a trade-off on the other side: each tick of half-spread costs 20 points of fill probability. Expected P&L per round is P(fill) x (half + skew - 0.7), and with the game's numbers that expression rewards a moderate spread over an ultra-wide one - a quote that never fills earns nothing, and the model's own delta already balances edge per fill against fill frequency plus inventory risk.
The Avellaneda-Stoikov quote: inventory moves your centre, time shrinks it
The reservation price r = s - q gamma sigma^2 (T - t) is the price at which you would be indifferent to buying or selling given the inventory you hold. Flat (q = 0): r equals fair, no lean. Long one unit early in the session (q = +1, T - t = 1, gamma = 1, sigma = 1.5): r = fair - 2.25, a hefty downward lean - your whole quote slides down so selling becomes easy and buying becomes unattractive, working you back toward flat. Short inventory mirrors it upward.
Each piece of the formula is intuition you should be able to narrate. q scales the lean because more inventory means more risk to unwind. sigma^2 scales it because inventory in a jumpier asset is more dangerous per round held. (T - t) scales it because risk is proportional to remaining holding time - by the last round there is almost no time for a position to hurt you, so the lean vanishes. The optimal spread has the same time-decaying inventory term plus a floor, (2/gamma) ln(1 + gamma/kappa), that compensates execution and adverse-selection risk and never decays - the spread shrinks toward the floor as the horizon approaches, never to zero.
For the typed check each round, the fast mental routine is: gamma sigma^2 = 2.25, so r = fair - 2.25 x q x (T - t). With q = -2 in round 6 of 10 (T - t = 0.5): r = fair + 2.25, done. Getting this reflexive is the point - the game is drilling the one closed-form quote model interviews actually name.
Read the signal, respect the base rates
The tip structure is a small Bayes exercise. Signals only ever come from informed rounds (55% of them tip their hand), so a BUY or SELL tip is fully reliable about direction: informed flow is coming and fair value will move 2 ticks that way. The model quote does not see the signal, so the signal is your context for interpreting fills - a fill against a tip is expensive, and the quiz's signal-skew question teaches the defence: on a BUY lean, shift both prices up, so an informed buyer who lifts your ask pays closer to where price is going, and your lowered-attractiveness bid keeps you from buying into a rally.
A quiet round is not a safe round. No signal means either noise (probability 0.65) or informed-but-undetected (0.35 x 0.45 = 0.1575), so about one quiet round in five is still informed. That residual 0.7-tick expected adverse-selection cost is exactly what the spread's floor term is there to cover.
Inventory management is the other half. Mark-to-market P&L hides the exit cost: every unit you carry to settlement costs 0.5 ticks to flatten. The reservation-price lean works positions off automatically, but watch the round track - a run of same-side fills means you are accumulating, and the flatten-and-cash-out option exists precisely for sessions where the P&L is good and the inventory is not.
A worked example
Round 4 of 10, fair = 101, and you are long 2 units from earlier fills. Reservation price: T - t = 1 - 3/10 = 0.70, so r = 101 - 2 x 1 x 1.5^2 x 0.70 = 101 - 3.15 = 97.85. Type 97.85 (the check allows 0.15 ticks of slack). The spread: delta = 2.25 x 0.70 + 2 ln 2 = 1.575 + 1.386 = 2.96 ticks, so half = 1.48, bid = 97.85 - 1.48 = 96.37, ask = 97.85 + 1.48 = 99.33 - both sides sit well below fair because the model is trying hard to sell your length.
Suppose the quiz asks expected P&L per fill: half + skew - 0.35 x 2 = 1.48 + (-3.15) - 0.70 = -2.37 ticks. That looks alarming, but read it correctly: the skew is not lost money on average, because a buyer lifting your cheap ask is also unwinding a 2-unit position whose mark-to-market risk and 1.0-tick flatten cost you no longer carry. The EV-per-fill formula prices the trade in isolation; the skew exists because the inventory cost lives outside it.
The round resolves: a counterparty lifts your ask at 99.33, taking you from +2 to +1, and the truth turns out to be noise with fair drifting to 100. You sold below the old fair, but your inventory risk is halved and your remaining flatten liability just dropped from 1.0 tick to 0.5. Over 10 rounds this is the rhythm of the game: collect the spread from noise flow, lean your quotes to shed inventory, and let the model shrink both lean and spread as the horizon runs down.
Common mistakes
• Ignoring adverse selection when judging a fill. With 35% informed flow moving 2 ticks, a fill is worth half + skew - 0.7 in expectation - a tight quote can fill often and still bleed.
• Fumbling the reservation-price sign. Long inventory pushes r below fair (you want to sell), short pushes it above. Writing r = fair + q... instead of minus is the classic slip the typed check catches.
• Forgetting (T - t) in the formula. The lean and the inventory part of the spread both decay linearly toward the horizon; using the round-1 lean in round 9 badly over-skews.
• Treating mark-to-market as banked P&L. Every unit held at the end costs 0.5 ticks to flatten, so a green MTM with a big position overstates what you will actually settle at.
• Reading a quiet signal as 'no informed flow'. Undetected informed rounds are about 16% of all rounds - the spread floor exists because the tip only fires 55% of the time.
Why interviews test this
Market-making interviews at trading firms lean on exactly this material. 'Make me a market' questions test whether you widen for uncertainty and skew for inventory; adverse-selection questions ('why is there a bid-ask spread?', 'what happens if you quote too tight?') are the breakeven arithmetic this game's quiz drills; and Avellaneda-Stoikov is the model quant-trading and e-trading desks name when they ask how optimal quotes should respond to inventory, volatility, and time to close.
The quiz bank doubles as flash cards for adjacent staples - put-call parity (c - p = S - K, so at-the-money call equals put), straddle pricing as call plus put, and the fact that hedging costs eat into captured edge. Being able to compute r and delta mentally, and to explain each term's economics, is a strong signal in any options or delta-one market-making interview.