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.

The most popular Hyperliquid SDKs work against GoldRush after a one-line baseUrl override and adding an Authorization header.

JavaScript / TypeScript: nomeida/hyperliquid

Install

npm install hyperliquid

Configure

import { Hyperliquid } from "hyperliquid";

const sdk = new Hyperliquid({
  // Point at GoldRush
  baseUrl: "https://hypercore.goldrushdata.com",
  // Inject the Authorization header on every request
  headers: {
    Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}`,
  },
});

// Existing methods work unchanged
const ctxs = await sdk.info.metaAndAssetCtxs();
const account = await sdk.info.clearinghouseState({
  user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
});
const spot = await sdk.info.spotClearinghouseState({
  user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
});
const orders = await sdk.info.frontendOpenOrders({
  user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
});
If your SDK version doesn’t expose a headers option, wrap fetch to inject the header globally before instantiating the SDK. See the patch pattern below.

Header injection fallback

const originalFetch = globalThis.fetch;
globalThis.fetch = (input, init = {}) => {
  const headers = new Headers(init.headers);
  if (typeof input === "string" && input.startsWith("https://hypercore.goldrushdata.com")) {
    headers.set("Authorization", `Bearer ${process.env.GOLDRUSH_API_KEY}`);
  }
  return originalFetch(input, { ...init, headers });
};

Python: hyperliquid-dex/hyperliquid-python-sdk

Install

pip install hyperliquid-python-sdk

Configure

import os
from hyperliquid.info import Info

# Point Info at GoldRush
info = Info(base_url="https://hypercore.goldrushdata.com", skip_ws=True)

# Inject the Authorization header on the underlying session
info.session.headers.update({
    "Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"
})

# Existing methods work unchanged
ctxs = info.meta_and_asset_ctxs()
account = info.user_state("0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00")
spot = info.spot_user_state("0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00")
orders = info.frontend_open_orders("0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00")
skip_ws=True is recommended when using the Info API only - it skips the WebSocket connection that the SDK opens by default to upstream Hyperliquid. For real-time event streams, use the GoldRush Streaming API instead.

Verification

After cutover, confirm everything is wired correctly:
  1. Diff a known wallet - call clearinghouseState for the same wallet against both endpoints; the JSON shape (keys, nesting, types) should match exactly.
  2. Confirm auth - remove the API key and confirm you get a 401 with body {"error":"unauthorized"}. If you get any other response, your request isn’t reaching GoldRush.

Other SDKs

The pattern is the same for any HTTP client: override the base URL to https://hypercore.goldrushdata.com and attach Authorization: Bearer <GOLDRUSH_API_KEY>. If you run into a specific SDK that doesn’t expose either knob, email us - we’ll publish a recipe.