Install
Quick Start
Context Manager
Async Client
Every method is available in both sync and async variants:REST Methods
Every REST endpoint has a typed method on thePolyNode client. All return Pydantic models with full IDE autocomplete.
Example: Market Data
Example: Wallet Activity
WebSocket Streaming
Subscribe to real-time events with a builder pattern. WebSocket is async-only (Python convention):Event Callbacks
Subscription Filters
All filters from the Subscriptions & Filters page are supported:Subscription Types
Multiple Subscriptions
Subscriptions stack on the same connection:Context Manager
Compression
Zlib compression is enabled by default for all WebSocket connections (~50% bandwidth savings). No configuration needed.Auto-Reconnect
Enabled by default. The SDK reconnects with exponential backoff and replays all active subscriptions:Cleanup
Orderbook Streaming
The SDK includes a dedicated orderbook client for real-time book data fromob.polynode.dev. This is a separate WebSocket connection from the event stream.
Subscribe
Event Handlers
LocalOrderbook
Maintain a sorted local copy of the book:Cleanup
OrderbookEngine
Higher-level wrapper that manages one connection, maintains local state, and routes updates to filtered views.Create and Subscribe
Query State
Filtered Views
Create lightweight views that only receive updates for specific tokens:Cleanup
Trading
Place orders on Polymarket with local credential custody and builder attribution. Requires the trading extras:Generate a Wallet
One-Call Onboarding
Place Orders
Cancel Orders
Open Orders
Pre-Trade Checks
Wallet Management
Address Derivation
Configuration
Signature Types
| Type | Value | Description |
|---|---|---|
SignatureType.EOA | 0 | Direct EOA signing (user pays gas for approvals) |
SignatureType.POLY_PROXY | 1 | Legacy Polymarket proxy wallet |
SignatureType.POLY_GNOSIS_SAFE | 2 | Gnosis Safe (default, gasless onboarding) |
Privy Signer (Server-Side Wallets)
Use Privy-managed wallets for headless server-side trading. No private key needed — signing is done through Privy’s wallet API:RouterSigner interface and works with all trading methods (ensure_ready, order, cancel_all, etc.). Gnosis Safe wallets (type 2) are fully gasless.
Cleanup
Configuration
Error Handling
Pydantic Models
All event types are Pydantic v2 models with full IDE support:PolyNodeEvent union uses Pydantic’s discriminated union on event_type:

