How a market maker should quote while carrying inventory

Market making is a control problem. Every fill earns a spread and also changes an exposure, and a useful quoting policy has to manage both at once.

The solved value of holding each inventory, one curve for every second left, from the tent at the close to the arch at the open. The pigment line is the inventory one simulated run held under the solved quotes; the plain line is that run at a fixed spread.

The quoting workbench

The workbench solves a finite-horizon inventory-control problem, then tests its quotes against two benchmarks on the same simulated market paths: a fixed spread that quotes both sides 1/k + f = 0.26 from the mid, a full spread of 0.52, and a zero-flow skew that uses the control's own quote rule with order flow switched off. The hostile-flow setting is where the model's assumptions start to fail, and it is the most useful run to look at.

The exchange and every price and order on it are made up. Nothing here trades, connects to a market or reports a real result.

sup E[ XT + qTST − c|qT| − φ∫qt²dt ]

The objective: terminal profit, less the cost of liquidating what is left and a penalty for the time spent carrying inventory. φ = ½γσ².

Runs in a background worker in your browser once JavaScript is on.

Method and limits: equations, execution assumptions and lineage

The numerical problem

V = x + qs + h(t,q), q ∈ {−Q,…,Q}, with Q = 8 by default. With τ = T−t, solve:

∂h/∂τ = −φq² + Σ maxδ≥0.01 A e−kδ[δ−f+h(q±1)−h(q)]
h(0,q) = −c|q|
δ* = max(0.01, 1/k + f + h(q) − h(q±1))

Transitions past the inventory limit are left out. Fourth-order Runge-Kutta with 600 time steps by default and linear interpolation in time. The run solves again with twice the steps (1,200 by default) and reports the largest quote difference over all inventory states at the start, midpoint and end: a check at those points only. A run whose quotes move by more than 0.01 price units under that halving has not settled, and it is refused with that reason.

With A = 0 the equation is linear and h = −c|q| − φq²(T − t) exactly. Every run solves that case on the same grid and reports the largest gap at the three plotted times.

The simulated exchange

60 seconds, initial mid 100, one-unit orders. Brownian mid-price, Poisson candidate orders at A=1 per side per second, exponential penetration with k=4 per price unit. Fee f=0.01 per fill; terminal liquidation c=0.12 per unit. All three policies share the same tape. The fixed spread quotes both sides 1/k + f = 0.26 from the mid at every refresh. The zero-flow skew uses the control's quote rule with the A = 0 value above, so it leans hard against inventory early in the run and relaxes toward the end.

A flow-linked jump moves the mid after matching, creating adverse selection. Quotes stay fixed between refreshes. Inventory bounds apply at every fill. Queue priority, partial fills, market impact, funding costs, tick rounding and measured exchange latency are outside the simulator; the refresh interval stands in for latency.

What the inference means

The paired 95% percentile bootstrap interval uses 1,500 resamples of per-path differences. It measures sampling noise inside the simulator; real markets are a separate question. The objective charges for carried inventory, so mean profit is only part of what the policy is solved for.

Stress cells reuse the seeds and freeze the original policy and both benchmarks, so they probe model risk. Parameters chosen after seeing results describe that choice, and an out-of-sample test would need fresh paths.

Research lineage

The starting point is the inventory-risk and exponential-fill framework in Avellaneda & Stoikov, and finite-inventory control studied by Guéant, Lehalle & Fernandez-Tapia.

This implementation uses a different objective, a quadratic running penalty on inventory, so it solves a different problem from their exponential-utility one. What it adds is a working solver, a simulator and an experiment whose result can go against the model.

What I am investigating

Inventory-aware execution, systematic decisions, the infrastructure around an AI-assisted trading-research process and the gap between simulated behavior and actual markets. The workbench above solves a real mathematical problem on a simulated exchange.

The next step would need calibrated event data, queue-aware replay and validation periods kept untouched until the end. Until then this is research on a simulated market, and none of it is trading advice or a track record.