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 BinaryOption instrument, allowing strategies to share logic while accounting for each venue's rules.
Research a strategy on historical data, test it against a live feed in the sandbox, then prepare it for production. Reuse strategy logic through the shared API while checking venue rules and live execution behavior.
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
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
Check strategy 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 settlement handled through each venue's adapter.
Reuse strategy logic
Backtests, sandbox runs, and live trading share the strategy API. Reuse your strategy logic while validating venue rules and live execution behavior.
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 BinaryOption instrument, each carrying its venue's price and size increments. The shared model lets strategies reuse logic across venues, while order parameters, quantity rules, and supported features vary. The adapters process venue resolution events or settlement fills, with winning outcomes paying one quote unit and losing outcomes 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>-<selected_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 outcomes: 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 yes/no markets on Hyperliquid, settled in each market's quote token.
Automatic loading: outcome instruments load at connect, with no client configuration.
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.
Shared API: a future adapter can expose Kalshi contracts through the same strategy API, subject to venue-specific rules.
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
50,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
Trade HIP-4 binary outcome markets with on-chain execution through 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.