> ## 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.

# Hyperliquid WebSocket Rate Limits & Connection Limits

> The public Hyperliquid WebSocket caps subscriptions at 1000 per IP. The GoldRush Hyperliquid WebSocket API removes that limit and adds wildcard subscriptions - stream every asset on one connection.

## Hyperliquid WebSocket rate limits

The **public Hyperliquid WebSocket** (`wss://api.hyperliquid.xyz/ws`) caps each IP at **1000 active subscriptions**, and most channels require one subscription per asset - so tracking the full market means fanning out hundreds of subscriptions and risking the cap.

**The GoldRush Hyperliquid WebSocket API removes that cap.** It's a [drop-in replacement](/goldrush-hyperliquid/websocket-api/migration) with **no per-IP, per-key, or per-connection subscription limit**, plus [wildcard subscriptions](#wildcard-subscriptions) that stream an entire channel over a single subscription.

## No subscription cap

With no subscription limit, you can:

* Open as many concurrent subscriptions as your client supports.
* Multiplex hundreds of `l2Book` subscriptions on a single connection.
* Track every active wallet, market, and asset from one process.

## Wildcard subscriptions

Filter parameters that the public Hyperliquid WebSocket **requires** are **optional** on GoldRush. Omit them to stream the entire channel on one subscription instead of fanning out one subscription per asset.

| Channel  | Public Hyperliquid                           | GoldRush                                                                                                   |
| -------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `l2Book` | `coin` required - one subscription per asset | `coin` optional - omit it to stream the **full L2 order book across every asset** on a single subscription |

So a single connection can stream Hyperliquid's full live book state without any client-side fan-out logic.

## How streaming works

Messages are pushed directly from a live Hyperliquid ingestion pipeline - no polling, no cache delay. Latency from upstream Hyperliquid event to your client is dominated by network round-trip from our Tokyo nodes.

| Channel  | Push trigger                                                         |
| -------- | -------------------------------------------------------------------- |
| `l2Book` | Every L2 update on the subscribed coin (or every coin, if wildcard). |

## Connection management

You're not rate-limited, but a few client-side defaults are worth tuning.

| Behavior             | Recommended client setting                                                                                                                                                                     |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Reconnect**        | On unexpected close, reconnect with exponential backoff capped at \~30 seconds. Re-send your subscription messages after the new socket opens.                                                 |
| **Heartbeat**        | Send an application-level `ping` every 30 seconds. The server replies with `pong`. Most WebSocket libraries handle this automatically; verify yours does.                                      |
| **Max message size** | L2 book snapshots for wildcard subscriptions can exceed 1 MB. Raise your client's `maxPayload` (Node `ws` library) or `max_size` (Python `websockets`) if you're receiving truncated messages. |
| **Backpressure**     | If your handler can't keep up with incoming messages, your client buffer will fill. Drain to a queue or downstream consumer; don't block the read loop on application work.                    |

### Reconnect sketch

<CodeGroup>
  ```typescript TypeScript theme={null}
  import WebSocket from "ws";

  function connect() {
    const ws = new WebSocket(
      `wss://hypercore.goldrushdata.com/ws?key=${process.env.GOLDRUSH_API_KEY}`,
      { maxPayload: 8 * 1024 * 1024 },
    );

    ws.on("open", () => {
      ws.send(JSON.stringify({
        method: "subscribe",
        subscription: { type: "l2Book" }, // wildcard - all assets
      }));
    });

    ws.on("close", () => setTimeout(connect, Math.min(30_000, backoff *= 2)));
    ws.on("error", () => ws.close());
    ws.on("message", handle);
  }

  let backoff = 1_000;
  connect();
  ```

  ```python Python theme={null}
  import asyncio, json, os
  import websockets

  async def consume():
      uri = f"wss://hypercore.goldrushdata.com/ws?key={os.environ['GOLDRUSH_API_KEY']}"
      backoff = 1
      while True:
          try:
              async with websockets.connect(uri, max_size=8 * 1024 * 1024, ping_interval=30) as ws:
                  backoff = 1
                  await ws.send(json.dumps({
                      "method": "subscribe",
                      "subscription": {"type": "l2Book"},  # wildcard
                  }))
                  async for raw in ws:
                      handle(json.loads(raw))
          except Exception:
              await asyncio.sleep(min(30, backoff))
              backoff *= 2

  asyncio.run(consume())
  ```
</CodeGroup>

## Watch out for client-side limits

GoldRush has no caps, but the rest of your stack might:

* **OS file descriptor limits** - if you're opening many connections in parallel, raise `ulimit -n`.
* **Reverse proxy idle timeouts** - if you're terminating WS through nginx, HAProxy, or a cloud load balancer, set the idle timeout above your heartbeat interval (typically 60 seconds minimum).
* **Browser concurrency** - browsers limit WebSocket connections per origin; one connection multiplexing many subscriptions is always preferable to many connections.

## Network and TLS

* **HTTP/1.1 Upgrade** to WSS is supported (standard WebSocket handshake).
* **TLS 1.2+** required.
* **Compression (`permessage-deflate`)** is negotiated when offered by the client.

## Need higher guarantees?

Enterprise SLA, dedicated capacity, regional pinning, and on-prem options are all available. [Email sales](mailto:sales@goldrush.dev?subject=Hyperliquid%20WebSocket%20API%20-%20Enterprise%20Inquiry).
