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.
Horizon provides a full-featured CLI for trading, discovery, wallet analytics, fund management, and strategy execution.
Install
pip
uv
Run without installing (uvx)
Run without installing (bunx)
Running Strategies
horizon run < strategy_fil e > [OPTIONS]
Flag Values Default Description --modepaper, livefrom strategy Override trading mode --dashboard / --no-dashboard- from strategy Override dashboard setting --log-leveldebug, info, warn, errorinfoLog level for Python + Rust
CLI options always take priority over the strategy file’s hz.run() arguments.
Paper with dashboard
Live with debug logging
Override dashboard off
horizon run examples/simple.py --dashboard
Trading from the CLI
# Search markets
horizon discover "bitcoin" --exchange polymarket
# Discover equities
horizon discover "AAPL" --exchange alpaca
# Get Kelly-optimal size
horizon kelly --prob 0.65 --price 0.50 --bankroll 1000
# Submit an order
horizon submit --market-id will-btc-hit-100k --side buy --price 0.55 --size 10
# Check positions
horizon positions
# Cancel everything
horizon cancel-all
Wallet Analytics
# Check wallet value
horizon wallet value 0x1234...abcd
# See trade history
horizon wallet trades 0x1234...abcd --limit 20
# Score trading performance
horizon wallet score 0x1234...abcd
Fund Management
# Deploy a strategy
horizon fund deploy --name my-mm --markets will-btc-hit-100k
# Check fund status
horizon fund status
# View risk dashboard
horizon fund risk
Equity & Options
# Stock quote
horizon equity quote AAPL
# Search stocks
horizon equity search "apple"
# Options chain
horizon equity options-chain AAPL --expiry 2026-04-17
# Greek exposure
horizon equity greeks SPY
# IV term structure
horizon equity iv-surface TSLA
# Stock screener
horizon equity screener --sector tech
JSON Output
Every command supports --json for scripting:
horizon discover "election" --json | jq '.[0].slug'
horizon top-markets --json | jq '[.[] | {slug, yes_price}]'
Database Commands
For offline analysis of persisted strategy data:
# Show fills from database
horizon db fills --path ./horizon.db --limit 20
# Show positions
horizon db positions --path ./horizon.db
# Show orders
horizon db orders --path ./horizon.db --all
How CLI Overrides Work
When running strategies, the CLI sets overrides in the _cli_overrides dictionary before loading the strategy module:
CLI parses --mode and --dashboard flags
Overrides are stored in horizon.strategy._cli_overrides
The strategy file is loaded and executed
When hz.run() is called, it reads _cli_overrides and applies them
This means hz.run() in the strategy file always runs. The CLI just changes its arguments.
All Commands
Run horizon --help for the full command list, or see the CLI Integration Guide for detailed documentation of all 50+ commands.