Risk limits
The desk quotes inside a fixed envelope. Each rule is checked on every tick. When a rule trips, the controller cancels every order and stops quoting until the desk is reset. The watchdog runs in the same process as the quoting loop, so a rule cannot be skipped.
| Rule | Threshold | Current | Headroom |
|---|---|---|---|
| Max absolute position | 0.050 BTC | 0.0140 BTC | 72% |
| Daily stop-loss | -2.5% ($20) | -0.12% | 95% |
| Stale feed breaker | 800 ms | 22 ms | 97% |
| Max order rate | 4 / s | 1.2 / s | 70% |
| Inventory band | 35% to 65% long | 58% long | inside |
| Max spread to quote | 6.0 bps | 1.5 bps | 75% |
The desk measures net base exposure against the position cap on every tick. Realized plus unrealized loss is tracked from the session open. Crossing either limit cancels all resting orders immediately.
A timestamp on the last exchange tick drives the stale breaker. If the socket goes quiet past 800 ms, quoting stops and the desk waits for a fresh tick. Order sends are rate-limited to four per second.
The desk keeps inventory inside a target band and skews quotes to pull back toward it. When the market spread exceeds six bps, the surface is too thin to quote safely and the desk widens or pulls instead.
| Time | Rule | Reading | Action |
|---|---|---|---|
| 14:02:18 | Order flow gate | OFI +2.64 | Pulled ask side |
| 14:00:44 | Order flow gate | OFI +2.11 | Pulled bid side |
| 13:41:07 | Inventory band | 68% long | Skewed quotes to sell |
No hard limit has tripped this session. The entries above are soft responses from the state machine, which keeps the desk inside its envelope before a hard stop is needed.