Data Providers
The Charts SDK includes three data providers that connect to polynode endpoints. All are optional. The chart itself works with any data source.PolynodeProvider
Full-featured REST provider for market data, candles, search, events, and multi-outcome charts.Top Markets
Search Markets
Fetch Candles
'1m', '5m', '15m', '1h', '4h', '1d'
Options:
OhlcData[]):
Price History (Line/Area Charts)
For simple{time, value} points (faster than candles — one HTTP call, no pagination):
'1h', '6h', '1d', '7d', '30d', 'all'
candles() fetches trades and builds OHLCV locally. Best for candlestick charts where you need resolution switching.priceHistory() hits the CLOB prices-history endpoint directly. Best for line/area charts where you just need price points over time.Get Event (Multi-Outcome)
EventInfo | null. The method searches your loaded markets, groups by shared question pattern, and returns all outcomes with prices and colors.
Response:
OUTCOME_COLORS (a 20-color palette).
Multi-Outcome Price History (Batch)
Fetch price history for all outcomes in parallel:outcomePrices() is much faster than fetching candles per outcome — one HTTP call each, no trade pagination.
For candlestick data per outcome, use outcomeCandles() instead:
Orderbook Snapshot
Poll for Live Updates
Market Resolution
All methods accept flexible market identifiers:- token_id — direct lookup (fastest)
- slug — matched against loaded markets (e.g.
'bitcoin-above-64k') - condition_id — hex string starting with
0x
Clear Cache
MarketInfo
PolynodeOBProvider
WebSocket-based orderbook streaming with automatic zlib decompression (uses the nativeDecompressionStream API, no dependencies).
Methods
The provider handles reconnection automatically with exponential backoff (1s to 30s).
Message Types
The provider processes three message types from the orderbook WebSocket:snapshot_batch— initial full book for all subscribed tokensbook_snapshot— full book replacement for a single tokenbook_update— incremental update (add/remove/change levels)
BookData before calling your callback.
ShortFormProvider
Discovers short-form crypto markets (5-minute, 15-minute, and hourly up/down markets) and provides live odds rotation. HTTP-only, no WebSocket required.One-Shot Discovery
Auto-Rotation with Live Odds
startRotation() discovers the current window, emits immediately, then polls for updated odds every second and re-discovers at each window boundary.

