# Engine status: PnL, open orders, positions, kill switch, uptime
python3 {baseDir}/scripts/horizon.py status
# List all open positions
python3 {baseDir}/scripts/horizon.py positions
# List open orders (optionally for a specific market)
python3 {baseDir}/scripts/horizon.py orders [market_id]
# List recent fills
python3 {baseDir}/scripts/horizon.py fills
Trading
# Submit a limit order: quote <market_id> <side> <price> <size> [market_side]# side: buy or sell, price: 0-1 (probability), market_side: yes or no (default: yes)
python3 {baseDir}/scripts/horizon.py quote <market_id> buy 0.55 10
python3 {baseDir}/scripts/horizon.py quote <market_id> sell 0.40 5 no
# Cancel a single order
python3 {baseDir}/scripts/horizon.py cancel <order_id>
# Cancel all orders
python3 {baseDir}/scripts/horizon.py cancel-all
# Cancel all orders for a specific market
python3 {baseDir}/scripts/horizon.py cancel-market <market_id>
Market Discovery
# Search for markets on an exchange
python3 {baseDir}/scripts/horizon.py discover <exchange> [query] [limit] [market_type] [category]
# market_type: "all" (default), "binary", or "multi"# category: tag filter (e.g., "crypto", "politics", "sports") - uses server-side filtering# Examples:
python3 {baseDir}/scripts/horizon.py discover polymarket "bitcoin"
python3 {baseDir}/scripts/horizon.py discover kalshi "election" 5
python3 {baseDir}/scripts/horizon.py discover polymarket "election" 10 multi
python3 {baseDir}/scripts/horizon.py discover polymarket "" 10 binary
python3 {baseDir}/scripts/horizon.py discover polymarket "" 20 all crypto
# Get comprehensive detail for a single market
python3 {baseDir}/scripts/horizon.py market-detail <slug_or_id> [exchange]
# Examples:
python3 {baseDir}/scripts/horizon.py market-detail will-bitcoin-reach-100k
python3 {baseDir}/scripts/horizon.py market-detail KXBTC-25FEB28 kalshi
Kelly Sizing
# Compute optimal position size: kelly <prob> <price> <bankroll> [fraction] [max_size]
python3 {baseDir}/scripts/horizon.py kelly 0.65 0.50 1000
python3 {baseDir}/scripts/horizon.py kelly 0.70 0.55 2000 0.5 50
# Get snapshot for a named feed
python3 {baseDir}/scripts/horizon.py feed <feed_name>
# List all feeds
python3 {baseDir}/scripts/horizon.py feeds
# Start a live data feed: start-feed <name> <feed_type> [config_json]# feed_type: binance_ws, polymarket_book, kalshi_book, predictit,# manifold, espn, nws, chainlink, rest_json_path, rest# Note: URL-based feeds (chainlink, rest_json_path, rest) require HTTPS public URLs.
python3 {baseDir}/scripts/horizon.py start-feed eth_usd chainlink '{"contract_address":"0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419","rpc_url":"https://eth.llamarpc.com"}'
python3 {baseDir}/scripts/horizon.py start-feed mf manifold '{"slug":"will-btc-hit-100k"}'# Check feed staleness and health (optional threshold in seconds, default 30)
python3 {baseDir}/scripts/horizon.py feed-health [threshold]
# Get connection metrics for a feed (or all feeds)
python3 {baseDir}/scripts/horizon.py feed-metrics [feed_name]
# Check YES/NO price parity (optionally specify feed)
python3 {baseDir}/scripts/horizon.py parity <market_id> [feed_name]
Contingent Orders
# List pending stop-loss/take-profit orders
python3 {baseDir}/scripts/horizon.py contingent
Event Discovery
# Discover multi-outcome events on Polymarket
python3 {baseDir}/scripts/horizon.py discover-events "election"
python3 {baseDir}/scripts/horizon.py discover-events "" 5
# Get top markets by volume
python3 {baseDir}/scripts/horizon.py top-markets polymarket 10
python3 {baseDir}/scripts/horizon.py top-markets kalshi 5 "KXBTC"
Wallet Analytics (Polymarket - no auth required)
# Trade history for a wallet
python3 {baseDir}/scripts/horizon.py wallet-trades 0x1234... [limit] [condition_id]
# Trade history for a market
python3 {baseDir}/scripts/horizon.py market-trades 0xabc... [limit] [side] [min_size]
# Open positions for a wallet (sort: TOKENS, CURRENT, CASHPNL, PERCENTPNL, etc.)
python3 {baseDir}/scripts/horizon.py wallet-positions 0x1234... 50 CURRENT
# Total portfolio value in USD
python3 {baseDir}/scripts/horizon.py wallet-value 0x1234...
# Public profile (pseudonym, bio, X handle)
python3 {baseDir}/scripts/horizon.py wallet-profile 0x1234...
# Top holders in a market
python3 {baseDir}/scripts/horizon.py top-holders 0xabc... [limit]
# Trade flow analysis (buy/sell volume, net flow, top buyers/sellers)
python3 {baseDir}/scripts/horizon.py market-flow 0xabc... [trade_limit] [top_n]
Each Fill now includes an is_maker field (True/False) indicating whether the order was a maker or taker. Works with both the paper exchange and BookSim (L2 backtesting).
Chainlink On-Chain Oracle Feed (v0.4.7)
Read prices directly from Chainlink aggregator contracts on any EVM chain:
Available signals: price_signal, imbalance_signal, spread_signal, momentum_signal, flow_signal. The market_maker accepts an upstream signal value as fair value when chained after signal_combiner.
Pipeline Features (v0.4.4)
The Horizon SDK also includes advanced pipeline components for automated strategies:
Markov Regime Detection (markov_regime) - Rust HMM (Hidden Markov Model) for real-time regime classification. Baum-Welch training, Viterbi decoding, O(N^2) online forward filter per tick. Supports pre-trained models or auto-train with warmup.
Edge Decay - measure how edge decays vs time-to-resolution
Walk-Forward Optimization - rolling/expanding window parameter optimization with purge gap
These are Python pipeline functions used with hz.run() and hz.backtest(). See the SDK documentation for usage.
New Features (v0.4.16)
AFML (Advances in Financial Machine Learning)
Rust-native implementations of Lopez de Prado's research:
Information-Driven Bars (hz.dollar_bars, hz.volume_bars, hz.tick_bars, hz.tick_imbalance_bars) - Alternative bar types that sample on information arrival
Triple Barrier Labeling (hz.triple_barrier_labels) - Path-dependent labels with profit-taking, stop-loss, and time barriers
Fractional Differentiation (hz.frac_diff_weights, hz.frac_diff_fixed) - Make series stationary while preserving memory