← Charlie Yan

quotesim

2026 — Python · numpy

Repository ↗

Avellaneda-Stoikov (2008) and Guéant-Lehalle-Fernandez-Tapia (2013) quoters behind one interface, in price space and in vol space (a derivation of the Stoikov-Sağlam 2009 tilt divided by vega). A delta-band hedger with a sqrt-law cost model. A P&L attribution of every run.

What’s tested

The published closed forms to their cited digits: A-S spreads, GLFT exact-versus-asymptotic offsets, Stoikov-Sağlam Theorem 4, Whalley-Wilmott bands. The flow model’s acceptance law and informed-markout expectation against the analytic value. Every Greek against finite differences. A fair object that raises on any future access and hands the quoter read-only copies.

The one rule

The top identity has no residual, and comparisons are paired by seed. spread + inventory + hedge - hedge cost = realised on every run, to the rounding of the summed products; sim.run raises otherwise. Only the Greek explanation layer carries a residual.

Two quoters are only ever compared on the same pre-drawn streams with paired differences. Never the best seed. Never an unpaired t-test.