16. Risk Management & Operations
Market making fails operationally before it fails mathematically. The boring chapter that keeps the account alive.
The non-negotiables
- Hard inventory limits — per market and aggregate, enforced in the engine (GLFT does it natively: hit the bound, stop quoting that side). A limit you can override under stress is not a limit.
- Kill switches — automatic full-cancel + halt on: max drawdown, inventory breach, stale market data (heartbeat timeout), abnormal order-to-fill latency, or connectivity loss. On Kalshi, set
cancel_order_on_pause; everywhere, know what happens to your resting orders when your process dies. Dead-man's-switch first, dashboard second. - Markout monitoring — your single most informative live metric (Ch. 5): price drift at +1s/+5s/+30s after your fills, by market, by side, by hour. Negative beyond half-spread = you're the exit liquidity; widen or leave.
- Event discipline — a calendar of scheduled releases (macro prints, earnings) and a real-time jump detector for unscheduled ones; both trigger the same reflex: widen/pull, reprice, re-tighten. In sports this fires on every scoring event.
- Fee accounting at trade granularity — the viability inequality (Ch. 7) audited daily. Many "profitable" MM books are profitable only before fees or only because of rebates; know which business you're actually in.
Kill switches feel abstract until you watch one work. The simulation below runs the same market twice — identical income, identical toxic episodes — once with no protection, once with an automatic drawdown halt. Slide the limit and watch the trade-off: too tight and you sit out good periods; too loose and a single toxic hour erases a month.
The triple barrier: three exits, decided in advance
The kill switch protects the whole book; the triple barrier protects each position. The idea (popularized by López de Prado, and the risk backbone of the live crypto experiments in Chapter 17): the moment a position opens, three exits are armed — a take-profit price above, a stop-loss price below, and a time limit. Whichever the price path touches first closes the trade. No debate, no "let me watch it a bit longer" — the exit was chosen before the entry, which is the entire point.
Sizing and capital
Size positions so the worst credible jump against a full inventory is an acceptable day, not an account event. In binaries the worst case is explicit: a full bound position moving to 0 or 1. In perps, include funding flips and liquidation cascades (JELLY, Ch. 11). Keep idle capital productive where the venue pays for it (Kalshi interest) but never let yield-seeking dictate position structure.
Regulatory hygiene
- Kalshi: CFTC-regulated; cleanest US-legal path for event contracts.
- Polymarket / Hyperliquid: smart-contract, oracle, and jurisdiction risk are part of the position. Self-custody discipline applies.
- US equities: liquidity provision yes, dealer-like patterns at scale can trigger registration questions (Ch. 13). Know the line before approaching it.
- Quoting conduct: spoofing/layering prohibitions apply to bots as to humans; your quoting logic should never place orders it intends not to honor.
15. The Algorithm Catalog
Eight families, from naive to frontier — each with its intuition, math, and honest weaknesses.
17. Crypto Market Making in Practice: From Signal to Live Bot
Everything so far, assembled into one reproducible workflow — following a real study (Stoikov et al., Cornell, 2024) that took a market-making bot from candlestick data to live trading on perpetuals, and published every step.