Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsHyperliquidHyperliquid HyperCoregRPC Streaming API

GetOrderBookSnapshot - Get Order Book Data

Retrieve a generated order book snapshot with individual order visibility from Hyperliquid L1 Gateway via gRPC.

Hyperliquid RPC endpoint: endpoint URLs, plans and pricing.

Retrieve a full order book snapshot at a specific point in time from the Hyperliquid L1 Gateway. Returns every individual open order across all markets with complete metadata including order IDs, timestamps, trigger conditions, and child orders.

Snapshot availability

This RPC is the public method for retrieving a generated order-book snapshot. Snapshots intentionally do not appear in ListFeeds. Snapshot availability and maximum response size vary by endpoint. Oversized responses return RESOURCE_EXHAUSTED.

Client receive limits

Large snapshots can exceed a gRPC client inbound message limit even when the endpoint can deliver the response. Client receive limits are separate from endpoint delivery limits. Configure them per client and workload; there is no universal fixed size that fits every snapshot.

Full Code Examples

Clone our gRPC Code Examples Repository for complete, runnable implementations in Go, Python, and Node.js.

When to Use This Method

GetOrderBookSnapshot is essential for:

  • Market Microstructure Analysis - Access every individual order with full metadata
  • Queue Position Tracking - See exact order placement timestamps and sizes
  • Whale Watching - Monitor large orders with their original sizes and trigger conditions
  • Trading Strategies - Analyze order distribution, TP/SL clustering, and trigger order density
  • Risk Management - Assess market impact with individual order granularity

Method signature

gRPC API version
protobuf
rpc GetOrderbookSnapshot(GetRequest) returns (Record) {}

The V3 RPC spelling is GetOrderbookSnapshot; this established page keeps the V2 GetOrderBookSnapshot URL and naming for compatibility. V3 accepts only an inclusive Unix-millisecond position.timestamp; position.block_number, filters, and explicit zero return INVALID_ARGUMENT. A positioned lookup returns the snapshot covering the requested timestamp. An empty GetRequest returns the latest existing snapshot rather than waiting for the next one.

protobuf
position: {
  timestamp: 1785736814057
}

In the V3 Record, block_number and timestamp are typed transport cursors. They are outside the snapshot JSON. Decoded Record.data is the snapshot's top-level array of [coin, [bids, asks]] tuples, and each side contains order objects. A timestamp outside retained history returns NOT_FOUND.

cURL request
grpcurl \
  -import-path content/docs/hyperliquid/grpc \
  -proto v3.proto \
  -H "x-api-key: ${DWELLIR_API_KEY}" \
  -d '{"position":{"timestamp":"1785736814057"}}' \
  "${HYPERLIQUID_GRPC_ENDPOINT}" \
  hyperliquid_l1_gateway.v3.HyperliquidL1Gateway/GetOrderbookSnapshot

Response Examples

Simple Limit Order (Bid)

JSON
{
  "coin": "0G",
  "side": "B",
  "limitPx": "0.59341",
  "sz": "52.0",
  "oid": 333003526755,
  "timestamp": 1772276628506,
  "triggerCondition": "N/A",
  "isTrigger": false,
  "triggerPx": "0.0",
  "children": [],
  "isPositionTpsl": false,
  "reduceOnly": false,
  "orderType": "Limit",
  "origSz": "52.0",
  "tif": "Alo",
  "cloid": "0x00000000000000000000000000000318"
}

Order with TP/SL Children

A parent limit order can have up to 2 child orders (stop-loss and/or take-profit) attached:

JSON
{
  "coin": "AAVE",
  "side": "B",
  "limitPx": "104.6",
  "sz": "1.94",
  "oid": 332954766819,
  "timestamp": 1772272640873,
  "triggerCondition": "N/A",
  "isTrigger": false,
  "triggerPx": "0.0",
  "children": [
    {
      "coin": "AAVE",
      "side": "A",
      "limitPx": "94.3",
      "sz": "1.94",
      "oid": 332954766820,
      "timestamp": 1772272640873,
      "triggerCondition": "Price below 102.5",
      "isTrigger": true,
      "triggerPx": "102.5",
      "children": [],
      "isPositionTpsl": false,
      "reduceOnly": true,
      "orderType": "Stop Market",
      "origSz": "1.94",
      "tif": null,
      "cloid": null
    },
    {
      "coin": "AAVE",
      "side": "A",
      "limitPx": "102.0",
      "sz": "1.94",
      "oid": 332954766821,
      "timestamp": 1772272640873,
      "triggerCondition": "Price above 110.87",
      "isTrigger": true,
      "triggerPx": "110.87",
      "children": [],
      "isPositionTpsl": false,
      "reduceOnly": true,
      "orderType": "Take Profit Market",
      "origSz": "1.94",
      "tif": null,
      "cloid": null
    }
  ],
  "isPositionTpsl": false,
  "reduceOnly": false,
  "orderType": "Limit",
  "origSz": "1.94",
  "tif": "Gtc",
  "cloid": null
}

Triggered Order

An order where the trigger condition has already been met and the order is now active:

JSON
{
  "coin": "ARB",
  "side": "A",
  "limitPx": "0.1099",
  "sz": "601.7",
  "oid": 331886608601,
  "timestamp": 1772189655929,
  "triggerCondition": "Triggered",
  "isTrigger": false,
  "triggerPx": "0.0",
  "children": [],
  "isPositionTpsl": false,
  "reduceOnly": true,
  "orderType": "Take Profit Limit",
  "origSz": "601.7",
  "tif": "Gtc",
  "cloid": null
}

Important Notes

  • Individual orders, not aggregated levels. Each entry is an individual order with full metadata (order ID, timestamp, trigger info, children, etc.).
  • Bids are sorted by price descending (highest price first). Asks are sorted by price ascending (lowest price first).
  • Children are never nested. Child orders always have an empty children array.
  • Trigger orders (isTrigger: true) have tif: null and meaningful triggerCondition / triggerPx values.
  • Once triggered, the order becomes isTrigger: false, triggerCondition: "Triggered", triggerPx: "0.0", and receives a tif value (typically "Gtc").

Best Practices

  1. Message Size Configuration: Configure the client inbound message limit per client and workload, and account separately for endpoint delivery limits; oversized responses return RESOURCE_EXHAUSTED
  2. Timeout: Use a generous timeout (60-120 seconds) for the RPC call due to the large response
  3. Data Validation: Always validate JSON structure before processing
  4. Error Recovery: Implement retry logic with exponential backoff
  5. Resource Management: Close gRPC connections properly to avoid resource leaks
  6. Streaming Alternative: For continuous updates, consider using StreamOrderbookSnapshots instead

Current Limitations

  • Replay History: Available snapshot history varies by endpoint; a timestamp outside retained history returns NOT_FOUND
  • Rate Limits: Be mindful of request frequency to avoid overwhelming the service
  • Availability: Snapshot availability and maximum response size vary by endpoint; oversized responses return RESOURCE_EXHAUSTED

Resources

  • GitHub: gRPC Code Examples - Complete working examples
  • Copy Trading Bot - Production-ready trading bot example
  • Pricing - Dedicated node cluster pricing details

Need help? Contact our support team or check the Hyperliquid gRPC documentation.

GetMiscEvents - Get Miscellaneous Event Data

Retrieve miscellaneous events at a specific position from Hyperliquid L1 Gateway via gRPC. Filter by user address. Get non-fill balance-affecting events for analysis and reconciliation.

GetOrderStatuses - Get Order Status Data

Retrieve order status events at a specific position from Hyperliquid L1 Gateway via gRPC. Get order lifecycle data for analysis and auditing.

On this page

When to Use This MethodResponse ExamplesSimple Limit Order (Bid)Order with TP/SL ChildrenTriggered OrderImportant NotesBest PracticesCurrent LimitationsResources