How SpreadGuard decides
A market maker gets run over by informed flow. The desk measures who is arriving at the book, and charges them a premium when the answer is someone who knows something. Four states, two signals, no discretion.
Net aggressive buy minus sell volume, normalized to a z-score over a 20-tick window. Positive means informed buyers are lifting offers; negative means sellers are hitting bids. The quoting gate sits at +2.00, the emergency pull at +3.50.
The z-score of taker volume arrival against its 20-tick baseline. It catches velocity bursts before they have a direction. The widening gate sits at +1.50.
Balanced flow. Six symmetric maker quotes rest on each side of the microprice, skewed up to 1.2 bps to pull inventory toward target. This is where the desk spends about 84 percent of its session.
Velocity burst without direction. Both bands widen 0.8 bps so the desk keeps quoting while the burst passes. Fill quality is protected before it can degrade.
Informed flow identified on one side. That side moves out 4 bps and halves size instead of leaving: the desk stays present and charges the toxic flow a premium. The quiet side tightens to keep the book balanced.
Extreme flow past +3.50 z. The fenced side cancels entirely. This is the emergency brake, reserved for the worst tape. It fires rarely and resumes as soon as flow drops back under the exit gate.
| Configuration | Volume | Net PnL | MaxDD | Desk time |
|---|---|---|---|---|
| Naive, no guard | $7,001 | -$1.74 | $3.33 | quoting 100% |
| Binary pull | $6,033 | -$1.31 | $2.79 | quoting 84%, widened 6%, pulled 9% |
| Step-back | $6,521 | -$1.57 | $2.75 | quoting 82%, widened 6%, stepped 10%, pulled 1% |
| Step-back plus microprice | $6,002 | -$1.05 | $2.47 | quoting 82%, widened 6%, stepped 10%, pulled 1% |
| Full suite, plus recycling | $7,170 | -$1.74 | $2.02 | quoting 82%, widened 6%, stepped 10%, pulled 1% |
Real recorded Binance USDT-M perpetual depth, 20 levels a side, resampled to the 250 ms tick. Fills use the recorded book sweep, so the desk only trades when the tape actually reaches its quotes. The guard beats the naive baseline at every maker fee from minus one to plus two basis points, and the microprice variant is the best configuration. Losses are small on a calm window, which is honest: a thin maker spread plus a rebate is the path to profit, not one quiet session. A deliberately harsher stress tape, where the guard cuts losses 46 percent, is in the README.
The desk centers on the microprice, the touch weighted by opposite size, not the naive mid. A thin ask pulls fair value up before the mid moves, so quotes anticipate the pressure instead of reacting to it afterward. Inventory recycling then sizes up the de-risking side, so round trips complete instead of accumulating one-sided exposure.