Hyperliquid Prediction Markets API
Hyperliquid prediction markets (HIP-4 outcome markets, Market.Kind outcome) trade on the same order book as spot. Each side of a market (Yes or No) is a market of its own, priced between 0 and 1: the price of a side reads as the market's probability of it. Every Bitquery cube with a Market names them under Market { Outcome { ... } } — the headline, the answer and the side — so a trade on #14730 arrives as 2026/2027 English Premier League winner, answer Arsenal, side Yes.
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 ➤
Two kinds of prediction market
- A standalone outcome is one Yes / No market with no question, such as
BTC above 78521 at 2026-10-31 06:00 UTC?. - A question has several answers, each an outcome with its own Yes / No market, plus a fallback answer,
Other, that wins when no named answer does:2026/2027 English Premier League winner→Arsenal, …,Other.
Each side is a separate market, CoinRaw #<n> with n = 10 × OutcomeId + Side, so a standalone outcome is two markets and a question with three answers is eight (three answers and Other, two sides each). Market.Outcome.Headline names the market as a whole, whichever kind it is, so group by Headline to add up both sides and every answer:
| Field | Standalone outcome | Answer of a question |
|---|---|---|
Outcome.Headline | BTC above 77970 at 2026-10-30 06:00 UTC? | 2026/2027 English Premier League winner |
Outcome.Title | same as Headline | Arsenal (Other for the fallback) |
Outcome.SideTitle | Yes / No | Yes / No |
Outcome.Question.Title | empty: there is no question | same as Headline |
Outcome fields
| Field | Meaning |
|---|---|
Headline | the market as a whole: a standalone outcome's Title, or the question's Question.Title |
Title | the outcome: a standalone outcome's text, or the answer of a question (Arsenal, Other) |
SideTitle | the side's display name: Yes / No, Over / Under, a team abbreviation (LAR / LAC) |
OutcomeId, Side | outcome id and side, 0 or 1; the first side is Side 0 |
SiblingCoin | the other side of the same outcome, #<n XOR 1> |
Name, Description, SideName | raw fields (template:sportsTournamentParticipant, participant:Arsenal) the titles are built from |
Question { QuestionId Title Name Description IsFallback IsSettled } | the question the outcome answers; empty for a standalone outcome. IsFallback marks Other, IsSettled an answer already settled |
Market { Outcome } is on Trades, Orders, BookUpdates, Twaps, SnapshotMarkets, SnapshotOrders and the other cubes with a Market. Candles and CurrentPositions have no Outcome fields: query them by Market.CoinRaw.
Top prediction markets by volume
Every fill is recorded twice, once for the buyer and once for the seller, so count volume and fills on the taker side only (IsAggressor: true). Without a Block.Time filter, Trades covers the last 24 hours.
query {
Hyperliquid {
Trades(
where: {Trade: {Market: {Kind: {is: "outcome"}, Outcome: {Headline: {not: ""}}}}}
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 20}
) {
Trade {
Market {
Outcome {
Headline
Question { QuestionId Title }
}
}
}
volumeUsd: sum(of: Trade_Execution_NotionalUSD, if: {Trade: {Execution: {IsAggressor: true}}})
fills: count(if: {Trade: {Execution: {IsAggressor: true}}})
traders: uniq(of: Trade_Trader_Address)
}
}
}
Add Title and SideTitle under Outcome to split each market by answer and side.
Every open market with its prices
SnapshotMarkets lists every market at the latest snapshot, about every 12.5 minutes. One row per outcome, its first side, with the best bid and ask and the last trade price:
query {
Hyperliquid {
SnapshotMarkets(
where: {Market: {Kind: {is: "outcome"}, Outcome: {Side: {eq: 0}}}}
limit: {count: 1000}
) {
Block { Time }
Market {
CoinRaw
Outcome {
Headline
Title
SideTitle
SiblingCoin
Question { QuestionId IsFallback IsSettled }
}
}
Book { BestBid BestAsk LastTradePx Orders }
}
}
}
The answers of one market and their odds
All answers and sides of one question, with prices. The midpoint of BestBid and BestAsk of a Yes side is the market's probability of that answer.
query {
Hyperliquid {
SnapshotMarkets(
where: {Market: {Outcome: {Headline: {is: "2026/2027 English Premier League winner"}}}}
) {
Block { Time Number }
Market {
CoinRaw
Outcome {
OutcomeId
Side
Title
SideTitle
Question { QuestionId IsFallback IsSettled }
}
}
Book { BestBid BestAsk LastTradePx Orders }
}
}
}
For the price history of an answer, use Candles with Market: {CoinRaw: {is: "#..."}}, the code of its side from this query. Add Block: {Time: {since_relative: {days_ago: 3}}} to the filter above for the odds at every snapshot of the last three days.
Trades of one side
query {
Hyperliquid {
Trades(
where: {Trade: {Market: {CoinRaw: {is: "#14730"}}, Execution: {IsAggressor: true}}}
orderBy: {descending: [Block_Time, Trade_Execution_Index]}
limit: {count: 50}
) {
Block { Time }
Trade {
Market { CoinRaw Outcome { Headline Title SideTitle } }
Execution { Price Size Side NotionalUSD }
Trader { Address }
}
}
}
}
Market codes come and go as outcomes are listed and settled; take a current one from the queries above.
Live prediction market trades
subscription {
Hyperliquid {
Trades(where: {Trade: {Market: {Kind: {is: "outcome"}}, Execution: {IsAggressor: true}}}) {
Block { Time }
Trade {
Market { CoinRaw Outcome { Headline Title SideTitle } }
Execution { Price Size Side NotionalUSD }
Trader { Address }
}
}
}
}
Holders of a side
A holding of a side is a spot balance of the side's token, +<n> for market #<n>, so its holders are in SnapshotBalances. One system address holds a negative balance equal to the whole supply; keep Total above zero.
query {
Hyperliquid {
SnapshotBalances(
where: {Token: {is: "+14730"}, Total: {gt: "0"}}
orderBy: {descending: Total}
limit: {count: 50}
) {
Block { Time }
Trader { Address }
Total
EntryNotional
}
}
}
Total is the number of contracts. EntryNotional / Total is the holder's average entry price, and Total × price − EntryNotional its unrealized PnL at the side's current price. The resting orders on a side, with their owners, are in SnapshotOrders with Market: {CoinRaw: {is: "#14730"}}.
Pitfalls
- Two rows per fill. Every fill has a buyer row and a seller row: count volume, fills and trades with
IsAggressor: true, or you double them. - Side names differ. Not every market is
Yes/No: sports markets use team abbreviations, othersOver/Under. UseSide(0or1) when you need the position of a side, andSideTitleto show it. - Complete sets. Buying or selling both sides of an outcome at once produces one fill per side, under the two sibling markets, with the two prices summing to 1.
- Perp fields are empty.
Prices,MarginandOpenInterestonSnapshotMarketsare perp-only; take the price of a side (0 to 1) fromBookor from its trades.
Related
- Snapshots API — the snapshots behind
SnapshotMarkets,SnapshotBalancesandSnapshotOrders - Trades & Candles
- Order Book API (L3)
- Hyperliquid API overview
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.