Prediction markets
Binary market
YES
50%NO
50%Backtest, simulate, and go live on prediction markets on a Rust-native engine with an optional Python API. Trade yes/no outcomes as native BinaryOption instruments on Polymarket, OKX event contracts, and Hyperliquid HIP-4, with Kalshi on the roadmap.
Backtest, sandbox, live
BinaryOption instruments
Polymarket, OKX, Hyperliquid
Written in Rust 🦀
Prediction markets let traders take positions on the outcome of real-world events, from elections and macro data to sports and crypto. Each market is a binary, yes-or-no proposition: a share pays a fixed amount if the outcome resolves in its favor and nothing otherwise, so the price trades between zero and one as a live probability.
NautilusTrader treats these markets as first-class instruments. Yes/no outcomes are modeled as BinaryOption instruments, matched on venue order books, and traded through the same event-driven engine used for equities, futures, and crypto. The v2 engine is Rust-native and can be built on directly in Rust or through the Python API, so the same strategy runs across backtesting, sandbox, and live execution.
Yes/no markets are live across several venues today: Polymarket's on-chain prediction market, handled by a Rust-native adapter, alongside OKX event contracts and Hyperliquid's HIP-4 binary outcome markets, with a Kalshi adapter planned. Each maps to the same BinaryOptioninstrument, so a strategy written against one venue's markets carries over to the next.
Research a strategy on historical data, validate it against a live feed in the sandbox, then deploy it to production. The same strategy runs in every stage; only the surrounding environment changes.
Backtest
Historical replay
Replay historical prediction-market data through the engine at full speed, with nanosecond timestamps and deterministic, reproducible results.
Event-driven simulation with realistic fills
Venue fee model for research-to-live parity
Reproducible runs from the same inputs
BacktestNode
Sandbox
Live data, simulated fills
Run the strategy against real-time market data through a simulated matching engine. Orders match against the live book without anything reaching the venue.
Live feeds, no real orders
No venue credentials required
Proves out live behavior before capital
SandboxExecutionClient
Live
Production execution
Point the same strategy at the live execution client to trade real orders, with full order, fill, and position reconciliation.
Signed orders on the venue
Order and position reconciliation
Same code as backtest and sandbox
TradingNode
One codebase, three environments
Backtest on history, paper-trade against live data in the sandbox, and go live, all from a single strategy implementation.
Native BinaryOption instruments
Yes/no outcomes are modeled as first-class BinaryOption instruments, with fixed-payout resolution handled in the core.
No code changes to go live
The strategy you backtest is the strategy you run live. Going to production changes configuration, not strategy code, because every stage shares the same engine semantics.
Sandbox before capital
The sandbox matches your orders against the live book with a simulated engine, so you can validate execution without risking funds.
Multi-venue by design
Strategies target the engine, not a venue. Yes/no markets are live on Polymarket, OKX, and Hyperliquid today, with Kalshi planned, alongside many other venues and data providers.
Open source, self-hosted
NautilusTrader is open source, with a Rust core and an optional Python API. Run the entire stack yourself, on your own infrastructure.
Prediction-market outcomes map cleanly onto a binary option: a fixed payout on one side of a yes-or-no question. NautilusTrader models them directly.
Polymarket outcome tokens, OKX event contracts, and Hyperliquid HIP-4 markets all load as the same BinaryOptioninstrument, each carrying its venue's price and size increments. Because the type is shared, a strategy that trades one venue's yes/no markets runs against another's without changes, and orders, fills, and positions behave consistently across backtest, sandbox, and live. Fixed-payout resolution is handled in the core: when a market settles, the winning side closes at one and the losing side at zero.
Yes/no markets on Polymarket span every category the venue lists, discovered and loaded at runtime.
Market categories · Thousands of live markets
Politics
Elections, policy
Crypto
Prices, events
Sports
Games, futures
Finance
Rates, markets
Culture
Awards, media
Weather
Climate, temps
Tech
AI, launches
Mentions
Public figures
+ More
Each market is a yes-or-no question, loaded as a binary option with an instrument ID of the form <condition_id>-<token_id>.POLYMARKET.
These categories are a representative sample. Polymarket lists thousands of individual yes/no markets across politics, crypto, sports, finance, and more, and new ones appear throughout the day; the adapter discovers them and auto-loads each one as a BinaryOption on demand.
NautilusTrader connects to prediction-market venues through Rust-native adapters. Several are live today and more are planned, all sharing the same BinaryOption instrument type.
Polymarket
Available now
Decentralized prediction market: stream the CLOB order book, quotes, and trades, and execute signed yes/no orders.
Thousands of markets: BinaryOption instruments auto-load from the Gamma API at runtime.
Data and execution in one Rust-native adapter.
OKX event contracts
Available now
EVENTS instrument type: OKX event contracts load as native BinaryOption instruments.
Yes/no, limit-only: traded with a yes/no outcome parameter and settled by delivery.
Unified account: alongside OKX spot, margin, swaps, futures, and options.
Hyperliquid HIP-4
Available now
Binary outcome markets: HIP-4 USDH-settled yes/no markets on Hyperliquid.
Opt-in: loaded by configuration when an account trades them.
On-chain execution: signed with an EVM key through the Rust adapter.
Kalshi
Planned
On the roadmap: a CFTC-regulated US prediction-market exchange targeted for a future adapter.
Same instrument model: Kalshi's yes/no contracts fit the existing BinaryOption type.
No strategy rewrite: the same code targets a new venue through configuration once the adapter ships.
The engine is designed for latency-sensitive trading, with the hot paths written in Rust.
Rust-native core
Order matching, the message bus, and data serialization run in Rust, and are continuously benchmarked to guard against regressions.
Nanosecond resolution
Nanosecond-resolution clocks and timestamps give backtests and live trading one precise, consistent notion of time.
Tested and hardened
Over 25,000 automated tests plus deterministic simulation soak testing back every release.
Starting points for building on prediction markets with NautilusTrader.
Backtesting quickstart
Load data, wire up a strategy, and run a backtest through the high-level API.
Read guide
BinaryOption instruments
How yes/no outcome markets are modeled and traded as instruments in the engine.
Read docs
Polymarket integration guide
Wallet setup, configuration, signing, and order handling for the live Polymarket adapter.
Read guide
OKX integration guide
Configure OKX event contracts and unified-account trading through the OKX adapter.
Read guide
Hyperliquid integration guide
Enable HIP-4 binary outcome markets and on-chain execution with the Hyperliquid adapter.
Read guide
Live adapter examples
Runnable example nodes for the Polymarket adapter: market-data and execution testers.
View on GitHub
Get started
Build your prediction-market strategy
Start with the open-source engine, backtest on historical data, and go live on Polymarket, OKX, or Hyperliquid, building in Rust or the optional Python API.
NautilusTraderâ„¢ is a product of Nautech Systems Pty Ltd (ABN 88 609 589 237). Nautech Systems provides algorithmic trading software only. We do not operate as a broker, dealer, or exchange, nor offer financial advisory services. Users are solely responsible for compliance with applicable laws and regulations. Subject to non-excludable consumer guarantees, we make no warranties and accept no liability for trading losses or regulatory violations arising from use of the software. Read full disclaimer.
We use essential cookies and, with your consent, optional analytics cookies, as described in our Privacy Policy. Manage your Cookie Preferences.