Skip to main content

Hyperliquid API

Bitquery indexes Hyperliquid core (the L1 order-book exchange) and exposes it through the Hyperliquid cube on the streaming API. Every dataset is available both as a GraphQL query and as a WebSocket subscription (real-time stream) — change query to subscription and drop limit/orderBy.

Video Tutorials

How far back the API goes

The Hyperliquid cubes serve a rolling ~30-day window. That covers live streaming and recent history, which is what most bots, dashboards and monitoring need.

For deeper history — backtests, multi-year research, full archive exports — use the Blockchain Data Lake, which serves the complete archive over S3 using the same protobuf schema as the Kafka streams. Contact sales@bitquery.io for archive access and custom export ranges.

API Key Required

To query or stream data outside the Bitquery IDE, you need an API access token.

Follow the steps here: How to generate Bitquery API token ➤

Available datasets

query {
Hyperliquid {
BookUpdates # order book deltas (new / change / remove)
Candles # OHLCV candles per market and interval
CurrentPositions # current open perp positions per trader
MarkPrices # latest mark price per market
Orders # order lifecycle: placed, filled, canceled, rejected
PerpFundings # per-trader funding payments
PerpLiquidations # perp liquidations
PriceUpdates # oracle / reference price updates
SignedActions # raw signed L1 actions (order, cancel, modify, ...)
TraderLeverageUpdates # leverage / margin-mode changes
Trades # fills with direction, fees, leverage, PnL
Twaps # TWAP order lifecycle
}
}
PageCubes covered
Trades & CandlesTrades, Candles
Orders, Order Book & TWAPsOrders, BookUpdates, Twaps
Mark Prices & Price UpdatesMarkPrices, PriceUpdates
Liquidations, Funding, Positions & LeveragePerpLiquidations, PerpFundings, CurrentPositions, TraderLeverageUpdates
Signed ActionsSignedActions
GuideWhat it covers
Track Order Flow by WalletMarket-maker tracking, cancel-to-fill ratios, wallet-level order lifecycles using L3 data
Bitquery vs Hyperliquid's free dataWhat the native Info API and s3://hyperliquid-archive do and don't cover

Why Bitquery instead of the native Hyperliquid WebSocket API?

The native Hyperliquid API is built for trading your own account. Bitquery is built for seeing the whole market:

CapabilityHyperliquid native WSBitquery
Scope of user data (orders, fills, funding, TWAPs, positions)Any single address you already know, one subscription each — no market-wide stream, no trader discoveryEvery trader on the exchange in one stream, or filter to any list of addresses
Order bookl2Book, aggregated (L2), 5–20 levels maxL3 (market-by-order) deltas, unlimited depth, order id + trader address on every order
LiquidationsPer-address only, via userEvents — no exchange-wide feedAll liquidations exchange-wide, with liquidated user, method, mark price, leverage
Open positionsPer-address snapshot (clearinghouseState) — cannot enumerate or rank the marketWhole market queryable (CurrentPositions): every open position, sortable and filterable
Historical dataLive + snapshot only; separate REST with pagination limits. The public s3://hyperliquid-archive bucket holds L2 book snapshots and asset contexts only — no trades, candles or spot — updated roughly monthly with no completeness guaranteeSame GraphQL query for history and live stream over a rolling ~30-day window; full archive via the Data Lake
FilteringPer-coin or per-user onlyAny field: market, trader, side, size, leverage, status
Fill contextRich (PnL, direction) only on per-user feeds; the public trades feed is bare price/size/sideDirection, fees, leverage, size-before, realized PnL on every fill, market-wide
Raw L1 actionsNot exposedSignedActions: action type, signer vs user (agent wallets), bundle, broadcaster
DeliveryWebSocket only; reconnect/gap handling yours; some feeds base64+DEFLATE encodedGraphQL WS + Kafka (protobuf, offsets, consumer groups, no gaps)
Subscription modelOne subscription per coin / per user, per-connection limitsOne stream can carry everything unfiltered, or a list of values on any filter field (many markets or wallets in one stream); runs 1,000+ concurrent streams at scale
Latency at market scaleFast for a single coin/user feed, but covering the whole market means hundreds of subscriptions, client-side merging and rate limitsLowest latency for the entire market in one pipeline — Kafka delivers every event exchange-wide, keyed by block, with no fan-out to assemble

Markets: perp, spot and HIP-3

Every cube carries a Market object that identifies the instrument:

FieldMeaningExample values
SymbolHuman-readable market symbolBTC, HYPE, AAPL
CoinRawRaw Hyperliquid coin id; HIP-3 markets are prefixed with their deployer namespaceBTC, xyz:SMSN, mkts:AAPL
KindMarket classperp, spot, hip3
IsPerptrue for perpetual markets (including HIP-3 perps)true / false
ProtocolHIP-3 deployer namespace, empty for native marketsxyz, mkts
MaxLeverageMaximum leverage allowed on the market40

HIP-3 markets are builder-deployed perps — tokenized stocks (mkts:AAPL), indices (xyz:KR200, TOTAL2) and other synthetic assets trade alongside native Hyperliquid perps and appear in the same cubes with Kind: hip3.

ChainId is hyperliquid-core on all event cubes.

Common fields

  • Block { Number Time } — Hyperliquid L1 block height and timestamp; filter with Block: {Time: {since_relative: {minutes_ago: 5}}} or absolute since/till.
  • Trader { Address Vault Signer Broadcaster SignedAt } — the account behind an event. Vault is set when the action is performed on behalf of a vault; Signer is the signing key (may be an agent/API wallet distinct from Address).
  • Numeric amounts (price, size, PnL, fees) are returned as strings at native precision; candle OHLCV values are floats.

WebSocket streams

Any query becomes a live stream over wss://streaming.bitquery.io/graphql (transport graphql-transport-ws):

subscription {
Hyperliquid {
Trades {
Block { Time }
Trade {
Market { Symbol }
Execution { Price Size Side Direction }
}
}
}
}

See WebSocket subscriptions for connection details.

Kafka streams (protobuf)

For the lowest latency, the same data is available as Kafka streams:

TopicProtobuf schema
hyperliquid.candles.protohyperliquid/candles.proto
hyperliquidcore.messages.protohyperliquid/hypercore.proto

See Kafka Streaming Concepts for access and consumer setup.

Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.