Pro Feature. Requires a Pro or Ultra subscription. Get started at api.mathematicalcompany.com
Market-Making Arbitrage
Quote on one exchange (earn the bid-ask spread), hedge on another exchange (neutralize directional risk). Combines Avellaneda-Stoikov market making with cross-venue delta hedging.How It Works
- Generate quotes on the quoting exchange using Avellaneda-Stoikov (reservation price + optimal spread)
- Track net position (delta) from fills
- When
|delta| > hedge_threshold: submit aggressive FOK orders on the hedge exchange - Result: you earn the spread on exchange A while staying delta-neutral via exchange B
MMArbConfig
| Parameter | Type | Default | Description |
|---|---|---|---|
quote_exchange | str | required | Exchange to quote on |
hedge_exchange | str | required | Exchange to hedge on |
quote_feed | str | required | Feed for quoting exchange |
hedge_feed | str | required | Feed for hedge exchange |
base_spread | float | 0.04 | Base spread width |
gamma | float | 0.5 | Avellaneda-Stoikov risk aversion |
max_position | float | 100.0 | Max hedge order size |
hedge_threshold | float | 10.0 | Delta threshold to trigger hedge |
hedge_aggression | float | 0.01 | Price improvement for hedge orders |
size | float | 5.0 | Quote size |
Pipeline: mm_arb
list[Quote]: generates quotes for the quoting exchange. Hedges are side-effects via the engine.
Example
MM Arb composes existing
reservation_price() and optimal_spread() Rust functions. See the Market Making docs for details on Avellaneda-Stoikov parameters.