Documentation Index
Fetch the complete documentation index at: https://mathematicalcompany.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Pro Feature. Requires a Pro or Ultra subscription. Get started at api.mathematicalcompany.com
Cross-Exchange Arbitrage
Buy on one exchange where the price is low, sell on another where it’s high. Horizon’s executor handles both legs atomically with auto-rollback on failure.How It Works
When the same market is priced differently across exchanges (e.g., Polymarket bid > Kalshi ask), you can buy on the cheap exchange and sell on the expensive one for risk-free profit.Engine Methods
scan_arbitrage
(feed_name, exchange_name, fee_rate).
execute_arbitrage
- Both legs go through the full risk pipeline
- Orders use Fill-Or-Kill (FOK) time-in-force
- If the buy succeeds but the sell fails, the buy is automatically canceled
- Returns
(buy_order_id, sell_order_id)on success
Pipeline: arb_scanner
| Parameter | Type | Default | Description |
|---|---|---|---|
market_id | str | required | Market to scan |
exchanges | list[str] | required | Exchanges to compare |
feed_map | dict[str, str] | required | Exchange name -> feed name |
min_edge | float | 0.01 | Minimum net edge |
max_size | float | 50.0 | Max execution size |
fee_rates | dict[str, float] or None | None | Fee rates per exchange |
auto_execute | bool | False | Auto-execute |
cooldown | float | 5.0 | Seconds between executions |
ArbResult in ctx.params["last_arb"] on execution.
One-Shot: arb_sweep
ArbResult or None.