Skip to main content

Hyperliquid Historical Data API

Hyperliquid historical data on Bitquery comes from two places. The Hyperliquid GraphQL API serves about the last 30 days of trades, candles, funding and liquidations. The Bitquery Data Store delivers bulk history as Parquet files.

This page shows how to use the Hyperliquid API for historical questions: past fills of a market, OHLCV over a window, funding rate history, liquidation data, a wallet's fills and PnL, and daily volume. Every query runs as written in the Bitquery IDE.

Hyperliquid data at a glance​

DataWhere it isHow far back
Trades (fills)Hyperliquid.TradesAbout 30 days
OHLCV candlesHyperliquid.CandlesAbout 30 days
Funding payments and funding ratesHyperliquid.PerpFundingsAbout 30 days
LiquidationsHyperliquid.PerpLiquidationsAbout 30 days
TWAPs, HIP-3 price updates, leverage changesHyperliquid.Twaps, PriceUpdates, TraderLeverageUpdatesAbout 30 days
Orders, order book updates, signed actionsHyperliquid.Orders, BookUpdates, SignedActionsAbout 7 days
Account state snapshotsHyperliquid.Snapshot* cubesAbout 7 days, one snapshot about every 12 minutes
Bulk history as ParquetBitquery Data StoreLast 30 days listed on all seven tables; older ranges on request

The per-cube table is on the data coverage and retention page.

How to get it​

Pick the route by how far back you need to go.

You needUseStart here
Fills, candles, funding or liquidations from the last 30 daysHyperliquid cubes over GraphQLExamples
Orders or book updates from the last 7 daysOrders, BookUpdatesOrders API
Positions and account state at a past moment in the last 7 daysSnapshot* cubesSnapshots API
Anything older than the API window, or full tables for a warehouseParquet from the Bitquery Data StoreHyperliquid exports

Three steps for the API route:

  1. Open the Bitquery IDE and paste a query from this page.
  2. Set the window with Block: { Time: { since_relative: { days_ago: 7 } } }. For a fixed slice, use after_relative and before_relative, or since and till with ISO times.
  3. To call the API from code, send the same query to https://streaming.bitquery.io/graphql with your token. See how to generate a Bitquery API token.

History older than the API window is in the Bitquery Data Store. Table schemas and sample files are on the Hyperliquid exports page.

Fields​

The fields used most often in historical queries. Each cube nests its event under one object: Trade, Funding, Liquidation, or Ohlc for candles.

FieldCubeMeaning
Block.Time, Block.Numberall event cubesTimestamp and height of the Hyperliquid block. Filter and order on Block.Time.
Market.CoinRawallUnique market id: BTC for the native perp, @107 for a spot pair, xyz:AAPL for a HIP-3 market.
Market.Symbol, Market.KindallReadable symbol and market class: perp, hip3, spot or outcome.
Execution.Price, Execution.SizeTrades, PerpLiquidationsFill price and size in base units, as strings at native precision.
Execution.NotionalUSDTradesFill value in USD. Sum it for volume.
Execution.Side, Execution.DirectionTrades, PerpLiquidationsBuy or Sell, and the effect on the position, such as Open Long or Close Short.
Execution.IsAggressorTradestrue on the taker row. Each match has a maker row and a taker row.
Execution.Index, Execution.TidTrades, PerpLiquidationsExecution order inside the block, and the fill id shared by both sides of a match.
Position.SizeBefore, Position.SizeTrades, PerpLiquidationsSigned position size before and after the fill. Negative is short.
Position.RealizedPnl, Position.NetPnlTradesPnL realized by the fill, and the same after fees.
Fees.Fee, Fees.FeeTokenTrades, PerpLiquidationsFee charged on the fill. A negative fee is a maker rebate.
Trader.Addressall event cubesThe account behind the event.
Funding.Rate, Funding.Amount, Funding.SizePerpFundingsHourly funding rate applied, signed payment (negative means paid), and the position size it applied to.
Liquidation.LiquidatedUser, Method, MarkPxPerpLiquidationsLiquidated account, market or backstop, and the mark price at liquidation.
Interval.Time.Start, Interval.Time.DurationCandlesCandle open time and length in seconds: 60, 300, 900 or 3600.
Ohlc.Open, High, Low, Close, VolumeCandlesCandle values as floats. Volume is in base units, taker fills only.

Examples​

All examples use the native BTC perp (CoinRaw: "BTC") or one active wallet. Swap in your own market or address.

How do I get historical Hyperliquid trades for one market?​

Query the Trades cube with a Market.CoinRaw filter and a Block.Time window: Run in the IDE. The filter keeps BTC perp fills from the last 7 days, newest first, ordered by block time and then by execution order inside the block.

{
Hyperliquid {
Trades(
where: {
Trade: { Market: { CoinRaw: { is: "BTC" } } }
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descending: [Block_Time, Trade_Execution_Index] }
limit: { count: 100 }
) {
Block {
Number
Time
}
Trade {
Market {
Symbol
CoinRaw
Kind
}
Execution {
Price
Size
NotionalUSD
Side
Direction
IsAggressor
Index
Tid
Hash
}
Fees {
Fee
FeeToken
}
Position {
Leverage
IsCross
SizeBefore
Size
RealizedPnl
}
Trader {
Address
}
}
}
}
}

Each match appears twice, once per counterparty. Add Execution: { IsAggressor: true } to keep one row per match.

How do I get Hyperliquid trades from a specific past day?​

Bound Block.Time on both sides with after_relative and before_relative: Run in the IDE. The window is the day between 21 and 20 days ago, and IsAggressor: true keeps the taker row of each match.

{
Hyperliquid {
Trades(
where: {
Trade: {
Market: { CoinRaw: { is: "BTC" } }
Execution: { IsAggressor: true }
}
Block: {
Time: {
after_relative: { days_ago: 21 }
before_relative: { days_ago: 20 }
}
}
}
orderBy: { descending: [Block_Time, Trade_Execution_Index] }
limit: { count: 100 }
) {
Block {
Number
Time
}
Trade {
Execution {
Price
Size
NotionalUSD
Side
Direction
Index
Tid
}
Trader {
Address
}
}
}
}
}

To walk through a whole day, keep the window narrow and page with limit: { count: 100, offset: 100 }.

How do I get historical OHLCV candles for a Hyperliquid market?​

Query the Candles cube with the candle length in Interval.Time.Duration: Run in the IDE. The filter asks for hourly BTC candles (3600 seconds) that opened in the last 7 days, so 168 rows cover the window.

{
Hyperliquid {
Candles(
where: {
Market: { CoinRaw: { is: "BTC" } }
Interval: {
Time: {
Duration: { eq: 3600 }
Start: { since_relative: { days_ago: 7 } }
}
}
}
orderBy: { descending: Interval_Time_Start }
limit: { count: 168 }
) {
Interval {
Time {
Start
Duration
}
}
Market {
Symbol
CoinRaw
Kind
}
Ohlc {
Open
High
Low
Close
Volume
}
}
}
}

For the whole API window, set days_ago: 30 and limit: { count: 720 }. Use 60, 300 or 900 in Duration for 1, 5 and 15 minute candles.

How do I get Hyperliquid funding rate history for a market?​

Group PerpFundings by hour and by Funding.Rate for one market: Run in the IDE. The filter takes BTC funding over the last 3 days, which gives one row per hourly settlement with the rate applied.

{
Hyperliquid {
PerpFundings(
where: {
Funding: { Market: { CoinRaw: { is: "BTC" } } }
Block: { Time: { since_relative: { days_ago: 3 } } }
}
orderBy: { descendingByField: "hour_Time" }
limit: { count: 72 }
) {
hour: Block {
Time(interval: { in: hours, count: 1 })
}
Funding {
Market {
Symbol
CoinRaw
}
Rate
}
accounts: count
net: sum(of: Funding_Amount)
}
}
}

Rate is the hourly rate. accounts is the number of accounts settled in that hour.

How do I get the funding payment history of a Hyperliquid wallet?​

Filter PerpFundings by Funding.Trader.Address: Run in the IDE. The filter returns every funding payment of one wallet in the last 7 days, newest first.

{
Hyperliquid {
PerpFundings(
where: {
Funding: {
Trader: {
Address: { is: "0x1f250df59a777d61cb8bd043c12970f3afe4f925" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 100 }
) {
Block {
Time
}
Funding {
Market {
Symbol
CoinRaw
}
Amount
Rate
Size
}
}
}
}

A negative Amount means the wallet paid funding. Per-market totals are on the Funding Payments API page.

How do I get Hyperliquid liquidation data for a market?​

Query PerpLiquidations with a Market.CoinRaw filter: Run in the IDE. The filter returns BTC perp liquidation fills from the last 7 days, newest first, with the liquidated account, method and mark price.

{
Hyperliquid {
PerpLiquidations(
where: {
Liquidation: { Market: { CoinRaw: { is: "BTC" } } }
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descending: [Block_Time, Liquidation_Execution_Index] }
limit: { count: 100 }
) {
Block {
Time
}
Liquidation {
Market {
Symbol
CoinRaw
}
Method
MarkPx
LiquidatedUser
Trader {
Address
}
Execution {
Price
Size
Side
Direction
Index
}
Position {
Leverage
IsCross
SizeBefore
Size
RealizedPnl
}
Fees {
Fee
FeeToken
}
}
}
}
}

A forced fill is recorded for the liquidated account and for each account on the other side. Rows where Trader.Address equals LiquidatedUser are the liquidated account's own fills.

How do I get daily Hyperliquid liquidation totals?​

Aggregate PerpLiquidations by day and method: Run in the IDE. The filter covers BTC over the last 7 days and returns the fill count, the size closed and the number of liquidated accounts per day.

{
Hyperliquid {
PerpLiquidations(
where: {
Liquidation: { Market: { CoinRaw: { is: "BTC" } } }
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descendingByField: "day_Time" }
limit: { count: 30 }
) {
day: Block {
Time(interval: { in: days, count: 1 })
}
Liquidation {
Method
}
fills: count
size: sum(of: Liquidation_Execution_Size)
accounts: uniq(of: Liquidation_LiquidatedUser)
}
}
}

fills and size count both sides of each forced fill, so halve them for the liquidated side alone.

How do I get a wallet's past fills on Hyperliquid?​

Filter Trades by Trade.Trader.Address: Run in the IDE. The filter returns every fill of one wallet in the last 7 days across all markets, with fees and the PnL realized by each fill.

{
Hyperliquid {
Trades(
where: {
Trade: {
Trader: {
Address: { is: "0x1f250df59a777d61cb8bd043c12970f3afe4f925" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descending: [Block_Time, Trade_Execution_Index] }
limit: { count: 100 }
) {
Block {
Time
}
Trade {
Market {
Symbol
CoinRaw
Kind
}
Execution {
Price
Size
NotionalUSD
Side
Direction
IsAggressor
Index
}
Fees {
Fee
FeeToken
}
Position {
Leverage
SizeBefore
Size
RealizedPnl
NetPnl
}
}
}
}
}

Add Market: { CoinRaw: { is: "BTC" } } inside Trade to keep one market.

How do I get a wallet's daily PnL on Hyperliquid?​

Aggregate the wallet's Trades by day and market and sum Position.RealizedPnl: Run in the IDE. The filter covers one wallet over the last 7 days and returns fills, USD volume, realized PnL, PnL after fees and fees per day and market.

{
Hyperliquid {
Trades(
where: {
Trade: {
Trader: {
Address: { is: "0x1f250df59a777d61cb8bd043c12970f3afe4f925" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descendingByField: "day_Time" }
limit: { count: 100 }
) {
day: Block {
Time(interval: { in: days, count: 1 })
}
Trade {
Market {
Symbol
CoinRaw
}
}
fills: count
volumeUsd: sum(of: Trade_Execution_NotionalUSD)
realizedPnl: sum(of: Trade_Position_RealizedPnl)
netPnl: sum(of: Trade_Position_NetPnl)
fees: sum(of: Trade_Fees_Fee)
}
}
}

This is trading PnL. Add the wallet's funding from the funding example for the full result.

How do I get daily trading volume per Hyperliquid market?​

Aggregate taker fills in Trades by day and market and sum Execution.NotionalUSD: Run in the IDE. The filter covers four perps over the last 7 days, and IsAggressor: true counts each match once.

{
Hyperliquid {
Trades(
where: {
Trade: {
Market: { CoinRaw: { in: ["BTC", "ETH", "SOL", "HYPE"] } }
Execution: { IsAggressor: true }
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
orderBy: { descendingByField: "day_Time" }
limit: { count: 40 }
) {
day: Block {
Time(interval: { in: days, count: 1 })
}
Trade {
Market {
Symbol
CoinRaw
}
}
volumeUsd: sum(of: Trade_Execution_NotionalUSD)
volume: sum(of: Trade_Execution_Size)
fills: count
traders: uniq(of: Trade_Trader_Address)
}
}
}

For a month of daily volume, set days_ago: 30 and raise limit to cover 30 rows per market.

How do I get Hyperliquid history older than 30 days?​

Use Parquet exports from the Bitquery Data Store. The export has seven tables: trades, perp_liquidations, twaps, order_updates, book_updates, price_updates and perp_fundings.

  • Listed range: the last 30 days on every table, including order and book updates.
  • Older ranges: available on request through the Data Store.
  • Delivery: download from S3 or R2, or delivery to your own bucket, Snowflake or BigQuery.
  • Schemas and samples: on the Hyperliquid exports page.

The Parquet files and the API share field definitions, so the same parsing code works on both.

Things to know​

  • Always set a time window. Without a Block.Time filter, Trades covers the last 24 hours. Add since_relative to reach further into the 30-day window.
  • Filter on CoinRaw, not Symbol. The same symbol can be a native perp and several HIP-3 markets. CoinRaw: "BTC" is only the native BTC perp.
  • Two rows per match. Trades has a maker row and a taker row for each fill. Use IsAggressor: true for volume and trade counts.
  • Order inside a block. All fills of a block share Block.Time. Order by [Block_Time, Trade_Execution_Index] for the exact sequence.
  • Amounts are strings. Price, size, PnL and fees keep native precision as strings. Candle values are floats.
  • Funding is hourly. PerpFundings has one row per account and market for each hourly settlement in which funding was charged.
  • Queries become streams. Change query to subscription and drop limit and orderBy to get the same data live. See the Hyperliquid API overview.
  • Older history. Dates before the API window are served by the Bitquery Data Store. Details are on the Hyperliquid exports page.

FAQ​

Frequently Asked Questions

How far back does Hyperliquid historical data go on Bitquery?

The Hyperliquid GraphQL API serves about the last 30 days of trades, candles, funding and liquidations, and about 7 days of orders, order book updates and account snapshots. Older ranges are delivered as Parquet files from the Bitquery Data Store.

Is there a Hyperliquid API for historical trades?

Yes. Query the Hyperliquid.Trades cube with a Market.CoinRaw filter and a Block.Time window. Each row has the price, size, USD value, side, direction, fees, trader address and the position before and after the fill.

How do I get Hyperliquid funding rate history?

Query Hyperliquid.PerpFundings for one market, group by hour and select Funding.Rate. That returns one row per hourly settlement with the rate applied. Filter by Funding.Trader.Address instead to get the payments of one wallet.

Where can I get Hyperliquid liquidation data?

The Hyperliquid.PerpLiquidations cube has every liquidation fill with the liquidated account, method, mark price, execution price and size. Filter by market for a market history or by LiquidatedUser for one wallet.

Can I get Hyperliquid OHLCV candles for a past window?

Yes. The Hyperliquid.Candles cube has 1 minute, 5 minute, 15 minute and 1 hour candles per market. Filter Interval.Time.Start for the window and Interval.Time.Duration for the candle length in seconds.

How do I calculate a wallet's historical PnL on Hyperliquid?

Filter Hyperliquid.Trades by Trade.Trader.Address and sum Trade_Position_RealizedPnl, or Trade_Position_NetPnl for PnL after fees. Group by day and market for a daily series, then add funding from PerpFundings.

Can I download Hyperliquid data as Parquet?

Yes. The Bitquery Data Store delivers Hyperliquid trades, liquidations, TWAPs, order updates, book updates, price updates and funding as Parquet files for S3, R2, Snowflake or BigQuery.

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.