Endpoint
Available streams
The WebSocket currently supports two real-time streams:| Stream | Subscribe with | What you receive |
|---|---|---|
| Vatic target prices | {"type":"subscribe","asset":"btc","marketTypes":["5min","15min"]} | window_open events at each Polymarket/Vatic market boundary |
| Hyperliquid mark prices | {"type":"subscribe","channel":"hyperliquid_mark_price","asset":"btc"} | hyperliquid_mark_price snapshots and live updates for the underlying perp mark price |
Why WebSocket over polling?
REST polling at window boundaries causes two problems:- 502 errors — Chainlink/Binance takes 1–5s to publish a price after a window opens. Polling at
:00means your request arrives before the price exists. - Rate limits — Hammering the endpoint while waiting burns your 120 req/min budget instantly.
markPrice that matters for prediction-market settlement.
Market types
| Type | Boundary | Price source |
|---|---|---|
5min | Every 5 minutes | Chainlink Data Streams |
15min | Every 15 minutes | Chainlink Data Streams |
1hour | Top of every hour | Binance aggTrades |
4hour | 00:00, 04:00, 08:00, 12:00, 16:00, 20:00 ET | Binance aggTrades |
daily | Midnight ET | Binance aggTrades |
btc, eth, sol, xrp, hype, doge, bnb
Connection flow
1. Connect
On connect the server immediately sends aconnected event:
2. Subscribe
Vatic target prices
Send a JSON message to subscribe to one asset across one or more market types:| Field | Type | Description |
|---|---|---|
type | "subscribe" | Required. |
asset | string | One of the supported asset symbols. |
marketTypes | string[] | One or more market types. Omit to subscribe to all five. |
subscribed event and immediately pushes a window_open snapshot for the current window of each subscribed type — so you always have the latest price on connect, without waiting for the next boundary.
Hyperliquid mark price
Send a JSON message to subscribe to the underlying perp mark-price stream:| Field | Type | Description |
|---|---|---|
type | "subscribe" | Required. |
channel | "hyperliquid_mark_price" | Required for the Hyperliquid mark-price stream. |
asset | string | One of the supported asset symbols. |
3. Receive price events
At every window boundary the server pushes awindow_open event:
"snapshot": true.
If the upstream price fetch fails after all retries, you receive window_open_error instead:
4. Unsubscribe
Heartbeat
The server sends a WebSocket ping every 30 seconds. If your client does not respond with a pong, the connection is terminated. Most WebSocket libraries handle this automatically.Examples
Node.js
TypeScript — Hyperliquid mark price
Python
TypeScript
Event reference
| Event | Direction | Description |
|---|---|---|
connected | Server → Client | Sent immediately on connect with supported assets and types. |
subscribed | Server → Client | Confirms a successful subscribe. Followed by current-window snapshots. |
unsubscribed | Server → Client | Confirms unsubscribe. |
window_open | Server → Client | Target price pushed at every window boundary. Also sent as snapshot on subscribe. |
window_open_error | Server → Client | Upstream price fetch failed after all retries. |
hyperliquid_mark_price | Server → Client | Live Hyperliquid underlying perp mark price, including oraclePrice, midPrice, funding, and openInterest. |
error | Server → Client | Invalid JSON, unknown asset, or unknown message type. |
subscribe | Client → Server | Subscribe to either Vatic target-price market types or a named real-time channel like hyperliquid_mark_price. |
unsubscribe | Client → Server | Remove all subscriptions for this connection. |