Skip to main content
The managed short-form stream discovers the active Polymarket crypto market, subscribes to its settlements, follows the matching Chainlink price source, and rotates to the next market window. Starting August 7, 2026 at 00:00 UTC, affected Polymarket short-form markets resolve against Chainlink-computed time-weighted average prices. Current SDKs select the required lookback automatically: 30 and 60 are lookback windows, not publication intervals. Read Polymarket’s August 7 announcement, the PolyNode transition guide, and Polymarket’s Chainlink TWAP guide for the schedule and underlying price semantics.
Use TypeScript 0.12.0+, Python 0.12.0+, or Rust 0.15.0+. Earlier versions do not implement the complete interval-to-TWAP mapping and rotation behavior documented here.

Managed stream

Choose an interval and, optionally, a subset of supported assets. The default is all seven: BTC, ETH, SOL, XRP, DOGE, HYPE, and BNB.

What rotation means

Market slugs and outcome-token IDs change at every boundary. Chainlink selection is also scoped to the WebSocket connection. The managed helper therefore owns a dedicated socket and performs this sequence at each boundary:
  1. close the old dedicated socket
  2. discover the new market slugs and token IDs
  3. connect a replacement socket
  4. subscribe to settlements for the exact new slugs
  5. subscribe to the interval’s exact Chainlink TWAP window, when applicable
  6. emit rotation with the new market metadata
This reconnect is expected and necessary. Do not place unrelated subscriptions on the managed stream’s dedicated connection; the helper isolates it for you. If discovery or subscription fails, the helper emits an error. Keep the error handler visible in production and restart the stream if it stops.

Rotation payload

Each discovered market includes the fields needed to connect other user-facing components: Python and Rust expose the same fields in snake_case. Rust’s RotationInfo also exposes twap_window_seconds for the selected interval.

Choose another interval

Each managed stream owns its own connection. If you need several intervals, monitor connection usage and stop streams you no longer need.

Subscribe to TWAP prices manually

Use a manual Chainlink subscription when you want price events without managed market discovery. Combine every feed and lookback needed on that socket into one subscription.
On every price event, inspect is_twap and twap_window_seconds; do not infer the price type from arrival frequency. If both windows are selected, key state by feed, window, and timestamp.

Connect the current market to the orderbook

Use the rotation payload’s outcome token IDs. Replace the previous token set whenever rotation fires:
See Orderbook streaming and PN1 for readiness, integrity errors, and cleanup.

Shutdown

Stop every managed stream you create. This cancels its rotation timer, removes subscriptions, and closes its dedicated connection.