Skip to main content
This guide walks through opening a connection, subscribing, and — if you’re already on Hyperliquid’s public WebSocket — migrating with a one-line change.
Grab your API key from the Uniblock dashboard.

1. Connect

Open a WebSocket to Uniblock’s endpoint and authenticate with the X-API-KEY header (recommended) or an apiKey query parameter.
Confirm your credentials before opening a stream: curl 'https://websocket.uniblock.dev/goldrush/validate' --header 'X-API-KEY: YOUR_API_KEY'

2. Subscribe

Send a subscribe message once the connection is open:
See the WebSocket overview for every channel and its payload shape.

Migrate from the public WebSocket

Switching from Hyperliquid’s public HyperCore WebSocket is a one-line change — the subscribe/unsubscribe message format is the same.
Uniblock adds GoldRush-native channels the public feed doesn’t have — l2BookDiff, l4Book, and liquidationFills. Once migrated you can drop any logic that worked around the 1000-subscription cap.

3. Keep the connection healthy

  • Keep-alive: send a ping every 30–60 seconds to avoid idle timeouts.
  • Reconnect with backoff: on disconnect, re-open and re-send every subscription using exponential backoff. On reconnect, discard local order book state and re-seed from the fresh snapshots rather than replaying missed updates.
  • Scope subscriptions: subscribe per coin rather than the wildcard stream when you only need a few assets — wildcard is billed at a much higher rate.

Next steps

L2 Order Book

L2 Book Diff

L4 Order Book