Back to Nautilus Trader

nautilus-polymarket

crates/adapters/polymarket/README.md

1.226.03.5 KB
Original Source

nautilus-polymarket

NautilusTrader adapter for the Polymarket prediction market.

The nautilus-polymarket crate provides client implementations (HTTP & WebSocket), data models and parsing for the Polymarket CLOB API for trading binary option contracts.

NautilusTrader

NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.

The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.

Feature flags

This crate provides feature flags to control source code inclusion during compilation:

  • python: Enables Python bindings from PyO3.
  • extension-module: Builds as a Python extension module.

High-precision mode (128-bit value types) is enabled by default.

API endpoints

The adapter communicates with three Polymarket API surfaces:

APIBase URLAuthPurpose
CLOB RESThttps://clob.polymarket.comL2 HMACOrders, trades, balances.
CLOB WebSocketwss://ws-subscriptions-clob.polymarket.com/wsL2 HMAC (user channel)Streaming orderbook, trades, order updates.
Gamma (Data)https://data-api.polymarket.comNoneMarket discovery, positions.

Authentication

Polymarket uses two-tier authentication:

  • L1 (EIP-712): Wallet-level signing for API credential creation and order signing via the CTF Exchange contract. Uses alloy signer crates.
  • L2 (HMAC-SHA256): API key + secret + passphrase for authenticated REST and WebSocket requests. Signatures expire after 30 seconds.

Documentation

See the docs for more detailed usage.

License

The source code for NautilusTrader is available on GitHub under the GNU Lesser General Public License v3.0.


NautilusTrader™ is developed and maintained by Nautech Systems, a technology company specializing in the development of high-performance trading systems. For more information, visit https://nautilustrader.io.

Use of this software is subject to the Disclaimer.

© 2015-2026 Nautech Systems Pty Ltd. All rights reserved.