Skip to main content

Documentation Index

Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Subscribe to a continuous stream of L2 order book snapshots for any Hyperliquid perp or spot asset. The payload is wire-equal to the public Hyperliquid l2Book WebSocket subscription - same channel name, same levels shape, same aggregation parameters. Point your client at wss://hypercore.goldrushdata.com/ws?key=<GOLDRUSH_API_KEY> and the rest of your code stays the same.

Endpoint

wss://hypercore.goldrushdata.com/ws?key=<GOLDRUSH_API_KEY>
key
string
required
Your GoldRush API key. Passed as a query parameter at connection time - no Authorization header is used.

Subscribe

Send this JSON message after the connection is established:
method
string
required
Always "subscribe".
subscription
object
required

Example

wscat -c "wss://hypercore.goldrushdata.com/ws?key=$GOLDRUSH_API_KEY"

> {"method":"subscribe","subscription":{"type":"l2Book","coin":"BTC"}}

Unsubscribe

Send the same subscription body with method: "unsubscribe":
{
  "method": "unsubscribe",
  "subscription": { "type": "l2Book", "coin": "BTC" }
}

Streamed message

Each message has channel: "l2Book" and a data payload with the current book snapshot for the subscribed coin.
{
  "channel": "l2Book",
  "data": {
    "coin": "BTC",
    "time": 1762450000123,
    "levels": [
      [
        { "px": "68210.0", "sz": "1.2345", "n": 3 },
        { "px": "68209.5", "sz": "4.5670", "n": 5 },
        { "px": "68209.0", "sz": "2.1100", "n": 2 }
      ],
      [
        { "px": "68215.0", "sz": "0.8900", "n": 2 },
        { "px": "68215.5", "sz": "3.4500", "n": 4 },
        { "px": "68216.0", "sz": "1.2300", "n": 1 }
      ]
    ]
  }
}
channel
string
Always "l2Book".
data
object

Notes

  • Wire-compatible with wss://api.hyperliquid.xyz/ws l2Book subscriptions - same channel name, same levels shape.
  • coin is optional on GoldRush. Omit it to stream the entire L2 order book across every asset on a single subscription. The public Hyperliquid API requires coin and locks each subscription to one asset at a time.
  • No 1000-subscription-per-IP cap - multiplex hundreds of l2Book subscriptions on a single connection.
  • For OHLCV candles instead of raw book state, use the Streaming API OHLCV streams.