Skip to main content

Endpoint

No authentication required. Connect once and subscribe to any supported asset / stream combination.

Available streams

The WebSocket currently supports two real-time streams:

Why WebSocket over polling?

REST polling at window boundaries causes two problems:
  1. 502 errors — Chainlink/Binance takes 1–5s to publish a price after a window opens. Polling at :00 means your request arrives before the price exists.
  2. Rate limits — Hammering the endpoint while waiting burns your 120 req/min budget instantly.
The WebSocket absorbs the publish lag server-side, retries the upstream fetch automatically, and pushes the resolved price to all subscribers the instant it’s ready. For Hyperliquid, it also gives you live access to the underlying markPrice that matters for prediction-market settlement.

Market types

Supported assets: btc, eth, sol, xrp, hype, doge, bnb

Connection flow

1. Connect

On connect the server immediately sends a connected event:

2. Subscribe

Vatic target prices

Send a JSON message to subscribe to one asset across one or more market types:
The server confirms with a 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:
The server confirms with:
It then immediately pushes a snapshot:
After the snapshot, the server keeps broadcasting updates whenever the upstream Hyperliquid perp context changes.

3. Receive price events

At every window boundary the server pushes a window_open event:
The initial snapshot after subscribe includes "snapshot": true. If the upstream price fetch fails after all retries, you receive window_open_error instead:

4. Unsubscribe

Removes all subscriptions for the current connection.

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