> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniblock.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GoldRush

> Stream Hyperliquid HyperCore order book and account data through Uniblock WebSockets.

GoldRush WebSockets give you real-time access to Hyperliquid's **HyperCore**
data — the native order book, perpetuals, and account event streams — through a
single Uniblock-managed connection. By connecting through Uniblock you get
unified authentication and billing without managing a separate GoldRush key.

<Info>
  HyperCore is Hyperliquid's native trading engine and isn't a permissionless
  chain you can run a node for. See
  [HyperCore vs. HyperEVM](/guides/quickstart-guides/hypercore-vs-hyperevm) for
  how the two components differ.
</Info>

## Endpoint

To connect to GoldRush WebSockets through Uniblock, use the following base URL:

```plaintext theme={null}
wss://websocket.uniblock.dev/goldrush
```

GoldRush uses a single fixed endpoint — no `chainId` query parameter is
required.

## Authentication

Uniblock supports two ways to authenticate your GoldRush WebSocket connection
and validation requests:

1. Header: Include `X-API-KEY: YOUR_API_KEY` in your request headers.
2. URL query parameter: Append `apiKey=YOUR_API_KEY` to the connection string.

<Note>
  Header authentication is recommended to avoid exposing your API key in URLs,
  server logs, or browser history.
</Note>

## Validate connection

Before integrating, use the validation endpoint to verify your credentials.

### Option 1: Header authentication

```bash theme={null}
curl --location 'https://websocket.uniblock.dev/goldrush/validate' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

### Option 2: URL authentication

```bash theme={null}
curl --location 'https://websocket.uniblock.dev/goldrush/validate?apiKey=YOUR_API_KEY'
```

## Subscriptions

Once connected, send a JSON `subscribe` message to start a stream. Each message
targets a subscription `type`, and most types accept an optional `coin` filter.

```json theme={null}
{
  "method": "subscribe",
  "subscription": {
    "type": "l2BookDiff",
    "coin": "HYPE"
  }
}
```

* `coin` accepts a single asset (`"HYPE"`) or an array (`["HYPE", "BTC"]`).
* Omitting `coin` streams **all** assets (wildcard) for the types that support
  it.

To stop a stream, send the matching `unsubscribe` message with the exact same
subscription body:

```json theme={null}
{
  "method": "unsubscribe",
  "subscription": {
    "type": "l2BookDiff",
    "coin": "HYPE"
  }
}
```

### Available subscription types

| `type`                        | Description                                            |
| ----------------------------- | ------------------------------------------------------ |
| `l2Book`                      | Full L2 order book snapshots and updates.              |
| `l2BookDiff`                  | Per-block L2 order book diffs (lighter than `l2Book`). |
| `l4Book`                      | Full L4 (per-order) order book. No wildcard support.   |
| `userFills`                   | Fills for a user account.                              |
| `orderUpdates`                | Order lifecycle updates for a user account.            |
| `liquidationFills`            | Liquidation fills.                                     |
| `allFills`                    | All fills across the venue.                            |
| `builderFills`                | Builder-attributed fills.                              |
| `userNonFundingLedgerUpdates` | Non-funding ledger updates for a user account.         |

## Pricing

GoldRush bills **credits per minute** for each active subscription, converted to
compute units at **5,000 CU per credit**. Charges accrue for as long as a
subscription stays open.

| Subscription                                                                                               | Credits / min | CU / min |
| ---------------------------------------------------------------------------------------------------------- | ------------- | -------- |
| `l2Book` (per coin)                                                                                        | 0.5           | 2,500    |
| `l2Book` (all assets)                                                                                      | 50            | 250,000  |
| `l2BookDiff` (per coin)                                                                                    | 0.1           | 500      |
| `l2BookDiff` (all assets)                                                                                  | 10            | 50,000   |
| `l4Book` (per coin)                                                                                        | 2             | 10,000   |
| `l4Book` (`BTC`)                                                                                           | 20            | 100,000  |
| `userFills`, `orderUpdates`, `liquidationFills`, `allFills`, `builderFills`, `userNonFundingLedgerUpdates` | 1             | 5,000    |

## Best practices

* Security: Use the `X-API-KEY` header where possible to avoid exposing your key.
* Keep-alive: Implement a heartbeat with ping/pong every 30 to 60 seconds to
  prevent connection timeouts.
* Reconnection: Use an exponential backoff strategy for reconnections to handle
  network instability.
* Cost control: Subscribe to specific `coin` values rather than the wildcard
  stream when you only need a few assets — wildcard subscriptions are billed at a
  much higher per-minute rate.

## Resources

* [GoldRush Hyperliquid WebSocket Documentation](https://goldrush.mintlify.app/api-reference/hyperliquid-websocket/l2-book-diff)
* [Hyperliquid WebSocket usage guide](/guides/quickstart-guides/hyperliquid-websocket-guide)
