Mind the gap

A game isomorphic to the sealed-bid market making problem. Three levels, two symmetries: the hard level is the medium one in a moving frame, and the medium level is the easy one after a skew and a slower clock.

← → move the gap (skew)  ·  ↑ narrow  ↓ widen  ·  space pause. Click the board first to give it the keyboard.

trading P&L
margins won minus carry paid
optimal dealer, same clock
ρ* × t, ρ* = per second
regret
how far behind the optimum you are
inventory
back pain per second
your skew / width
optimal now:
fill ratio
won / enquiries
mark-to-market
Σ x·dF, which has zero mean
balanced twin, shifted by δ

The isomorphism

falling iteman enquiry: green is a seller (a buy opportunity for you), red a buyer where it landsthe best competing quote, an exponential distance of mean w from the fair value the gapyour bid and offer; an item landing in the gap went to a competitor a catcha won enquiry, at a margin equal to the distance from fair value to the bar's edge, less ε. The quote that counts is the one you had out when the ball appeared; moving the bar while it falls changes nothing the traycaught balls stay on the bar; a green and a red cancel each other off it, and what remains is your inventory back painthe carrying cost a x2 per second, deducted continuously dashed gapthe policy-iteration optimum at your current inventory; autopilot plays it

The two symmetries

On the medium level the optimal gap is the easy level's optimal gap at carry M(q) a, shifted toward the sellers by δ = (w/2) log(q/(1−q)). Both policies are solved independently and the deviation tile reports the difference. A flat book still skews: the dashed gap is off centre before anything has been caught.

On the hard level the fair value is a martingale, reflected at the edges of the board, and the bar is in absolute price, so the market drifts away from the quotes. Quoting relative to the fair value recovers the medium level.

The mark-to-market term Σ x·dF has zero mean and changes no decision. A dealer who dislikes its variance pays λσ2x2/2 per unit time for it, and that is the back pain: the quadratic carrying cost is the price risk.

Model: market width w = 1, adverse selection ε = 0.25, inventory capped at ±6, mean inter-arrival one second. The default carry lies within the theorem's interior region on this lattice. The benchmark policy is policy iteration from a flat cold start (fourcorners_core.js); the game logic is game_core.js. Companion to On a Simple Relationship Between Order Imbalance, Skew and Width in Over-The-Counter Trading.