Data access · 9 min read

Hyperliquid data for agents: perp analytics through one tool family

An agent that already reads ERC-20 swaps or Solana instructions can answer whole-market questions about Hyperliquid perpetuals without learning anything new. The Portal exposes Hyperliquid through the same three verbs it uses for every chain: a market snapshot, candles, and raw records. That cross-machine uniformity, one interface for perps, swaps, and UTXO flows, is the point. This guide runs all three against the live fills dataset and keeps the data boundary honest. The fills and the analytics snapshot are pinned to fixed windows and reproduce; the candle run covers recent history, so those values move.

Updated 2026-06-18 · By the SQD team

1. The same three tools, one more venue

The Portal's tools follow a pattern across virtual machines. For each chain there is a way to pull raw records, a way to get a market-level analytics summary, and, where it makes sense, a way to build OHLC candles. Hyperliquid is not a special case bolted on the side; it uses the same verbs.

CapabilityEVMSolanaHyperliquid
  • Raw records query_logs / query_transactions query_instructions query_fills
  • Market analytics get_analytics get_analytics get_analytics
  • OHLC candles get_ohlc n/a get_ohlc
Tool names share a suffix across chains. An agent that knows get_analytics on EVM already knows it on Hyperliquid.

2. A whole-market snapshot

portal_hyperliquid_get_analytics with coin: ["BTC"] over a one-hour window answers "what is the BTC perp market doing right now" in a single call. A recent run returned the headline figures below, alongside ranked sections for top traders by volume and the realized-PnL winners and losers.

Fills
25,282
Unique traders
2,044
Volume
$192.4M
Liquidations
465
BTC perp, the fixed window 2026-06-18 12:00 to 13:00 UTC: 25,282 fills across 2,044 traders, $192.4M volume, 465 liquidations (1.8% of fills). The same call also reports a long/short ratio of 0.755 (short-biased), total fees of $32.8k, and net realized PnL of +$52.6k across the window. Pinned to timestamps via from_timestamp and to_timestamp, so this snapshot reproduces.

That is a market overview an agent can reason about directly: participation, notional, liquidation pressure, and directional bias, without stitching together raw rows. The ranked sections give it the leading accounts to drill into next.

3. Candles without a candle service

portal_hyperliquid_get_ohlc turns the same fill tape into chart-ready candles, with open, high, low, close, volume, VWAP, and a per-bucket fill count, derived from trades rather than from a separate candle feed. A six-hour BTC request, run on 2026-06-19, returned 24 fifteen-minute buckets, all populated. This tool always covers recent history, so your buckets will differ; the shape and the per-bucket detail are the point:

MetricValue
  • Fills / volume155,296 fills · 13,658 BTC · $856.7M
  • Series open, close62,936, 62,817
  • Busiest bucket (03:15 UTC)O 62,710 H 62,853 L 62,350 C 62,819
  • Busiest bucket flowVWAP 62,556.91 · 22,196 fills · $271.7M
BTC · 15m candles · last 6h · 24 of 24 buckets populated

Because the candles come from the underlying fills, the VWAP and fill count per bucket are exact for the data set rather than approximations, and the same OHLC tool shape works on EVM DEX trades. This is the read-only counterpart to building your own candle table, which the Pipes SDK leaderboard guide does by streaming the same tape into ClickHouse.

4. Down to the fill

When the agent needs the underlying trades, portal_hyperliquid_query_fills returns raw rows, the same fills you can pull straight from the Stream API. Each carries the trader, coin, side (B is buy, A is sell), direction, price, size, fee, closedPnl, a shared trade id (tid), and a crossed flag that marks the taker. Here is the curl and a real pair of fills from one execution, the maker and taker sides:

your terminal
curl -s -X POST https://portal.sqd.dev/datasets/hyperliquid-fills/stream \
-H 'content-type: application/json' \
-d '{
"type": "hyperliquidFills",
"fromBlock": 1040185130, "toBlock": 1040185150,
"fills": [{ "coin": ["BTC"] }],
"fields": {
"fill": { "user": true, "coin": true, "side": true, "dir": true, "px": true, "sz": true, "fee": true, "closedPnl": true, "crossed": true, "tid": true }
}
}'
live response · portal.sqd.dev
// the stream returns one line per block: {"header":{},"fills":[ ... ]}
// two entries from that fills array sharing one tid, the maker and taker
// sides of a single 0.32328 BTC execution (crossed: true marks the taker):
{ "user": "0x6e8bc7cd0978397b06a14af2a8c31f5daeffea79", "coin": "BTC",
"px": 64125.0, "sz": 0.32328, "side": "B", "dir": "Close Short",
"closedPnl": -33.62112, "fee": -0.621909, "crossed": false,
"tid": 877330457166033 }
{ "user": "0xf27359c75d661b7e2e3ed5f3a2a717ba56fb3d1c", "coin": "BTC",
"px": 64125.0, "sz": 0.32328, "side": "A", "dir": "Open Short",
"closedPnl": 0.0, "fee": 9.328648, "crossed": true,
"tid": 877330457166033 }

Both rows share one tid, which is what proves they are the two sides of a single execution; crossed: true marks the taker (the aggressor), while the resting maker side carries the negative fee, a rebate, against the taker's positive fee. The maker's closedPnl is the realized result of closing part of a short. Net realized PnL for a trader is the sum of closedPnl across their closing fills minus the sum of fee, both read from the records, not reconstructed from positions. Fees are signed, so a negative maker rebate adds to the total and a positive taker fee subtracts; ignore the field and you misstate the result whenever fees are in play. That boundary matters: the dataset is executed trades, so it does not report open positions or balances. The full fill schema and the way Hyperliquid classifies its crypto, TradFi, and HIP-3 markets are covered in the Hyperliquid perps data guide.

5. The pagination gotcha

The analytics tools return a preview page. The ranked sections, top traders and PnL winners and losers, can have more rows behind a cursor, and the response carries a _pagination.next_cursor plus a has_more flag per section. An agent that reads only the first page and reports "the top trader is X" may be right about the page and wrong about the window.

"_pagination": {
"has_more": true,
"next_cursor": "eyJ2...",
"sections": { "top_traders_by_volume": { "has_more": true } }
}

The rule for the agent is to follow the cursor until has_more is false before treating a ranking as complete. One smaller thing in the same spirit: the coin filter is an array, so a single market is ["BTC"], not "BTC".

6. Why this is harder elsewhere

The exchange's own info endpoint answers per-account and per-market questions, but it is rate limited and shaped for one venue. Turning the entire fill tape into a single queryable dataset, in the same request shape and tool family as EVM and Solana, is the part that takes work.

The argument here is not coverage breadth: other tools index Hyperliquid too, some more deeply. It is uniformity. An agent that reads perps, swaps, and UTXO flows through one interface has one calling convention to learn and one place to add the next chain, which is what the cross-machine tool family delivers.

For the conceptual pattern behind agents calling these tools, see AI agents and onchain data, and to wire the tools into an editor, the Portal MCP setup. To own the fill data in your own warehouse, the Pipes SDK leaderboard guide is the build companion.

Frequently asked questions

How does an agent read Hyperliquid perp data through SQD?
Through the same Portal tool family it uses for every other chain. portal_hyperliquid_get_analytics returns a whole-market snapshot, portal_hyperliquid_get_ohlc builds candles, and portal_hyperliquid_query_fills returns raw fill rows. These mirror the EVM and Solana analytics, OHLC, and query tools, so an agent that already reads swaps or instructions reads perps with the same calling pattern and no new mental model.
What is in a Hyperliquid fill record?
Each fill carries the trader (user), the coin, the side (B or A), the direction (Open Long, Close Short, and so on), the price px, the size sz, the fee, and closedPnl. A negative fee is a maker rebate; a positive fee is a taker fee. closedPnl is the realized profit or loss booked when a fill closes part of a position. The fill record and the market classification are covered in depth in the Hyperliquid perps data guide.
Can SQD tell me a Hyperliquid trader's current position or balance?
No. The dataset is fills, the executed trades. Realized PnL is summed from the closedPnl field on closing fills, read straight from the record rather than reconstructed. Open positions, account balances, and margin are account state, which is outside this data set. Treat the answers as trade-flow analytics, not a positions or balances feed.
Why might a Hyperliquid analytics query look incomplete?
The analytics tools paginate. A response carries ranked sections (top traders, PnL winners and losers) that can have more rows behind a cursor, and _pagination.next_cursor tells you whether more exist. Treat a single page as a preview and follow the cursor before calling the window complete. The coin filter is also an array, so a single coin is passed as ["BTC"], not "BTC".
Is no-indexer Hyperliquid analytics unique to SQD?
No, and that is not the claim. Several tools can answer Hyperliquid questions without you deploying an indexer. What is specific here is that the full exchange fill tape is one queryable dataset in the same request shape and tool family as every other chain SQD serves, so an agent uses one interface for perps, swaps, and UTXO flows rather than a separate per-venue endpoint for each.

Building a perp-data agent or dashboard?

See how Hyperliquid and every other market feed trading products on the DeFi and trading solution page.