> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hyperliquid HIP-4

> Curated datasets for Hyperliquid HIP-4 outcome (prediction) markets on Dune

HIP-4 is Hyperliquid's outcome-market standard: binary Yes/No prediction markets that trade on HyperCore order books next to Hyperliquid's perpetuals. Dune provides the full HIP-4 ledger — every fill leg, including the engine legs that mint, burn and settle outcome tokens — plus market metadata, hourly candles, hourly open interest, and daily account positions.

<Info>
  **Maintained by:** Dune · **Refresh:** hourly (`positions_daily` daily) · **Source:** Hyperliquid (HyperCore node fills and venue metadata) · **History:** from 2026-05-02
</Info>

## Available Tables

<CardGroup cols={2}>
  <Card title="hip4_hyperliquid.market_details" icon="database" href="/data-catalog/curated/prediction-markets/hip4/market_details">
    One row per market: question, sides, event grouping, strike, expiry, and settlement
  </Card>

  <Card title="hip4_hyperliquid.market_trades" icon="database" href="/data-catalog/curated/prediction-markets/hip4/market_trades">
    Every fill leg: trades plus split, merge, negate and settlement legs
  </Card>

  <Card title="hip4_hyperliquid.ohlcv_hourly" icon="database" href="/data-catalog/curated/prediction-markets/hip4/ohlcv_hourly">
    Hourly OHLCV candles with VWAP, one series per outcome token
  </Card>

  <Card title="hip4_hyperliquid.open_interest_hourly" icon="database" href="/data-catalog/curated/prediction-markets/hip4/open_interest_hourly">
    Hourly open interest and traded volume per market
  </Card>

  <Card title="hip4_hyperliquid.positions_daily" icon="database" href="/data-catalog/curated/prediction-markets/hip4/positions_daily">
    Daily holdings per account and outcome token, valued at the end-of-day price
  </Card>
</CardGroup>

## Key concepts

* **Market = one binary contract.** `market_id` is Hyperliquid's outcome index. Every market has two outcome tokens, `yes_outcome_id` and `no_outcome_id`, in Hyperliquid's coin notation `#N`. `outcome_index` 0 is Yes and 1 is No. A Yes token pays 1 in the quote stablecoin if the market settles yes; a No token pays 1 if it settles no.
* **Events group mutually exclusive markets.** Where the venue groups markets into a question (for example, "Winner of English Premier League 2026/2027"), each member market carries the same `event_id` and `market_type = 'question_outcome'`. Standalone markets have a null `event_id`. An event can include a fallback outcome (`is_fallback`) that settles yes when none of the named outcomes happens.
* **Both sides have their own book.** The Yes and No tokens trade separately, and the book can also match a Yes buyer with a No buyer at prices that sum to 1. Prices are always the price of the token on that row, not the Yes price. On a No row, take `1 - price` for the implied Yes probability.
* **Quote stablecoin.** Markets are collateralised in USDC. The earliest markets used USDH. `*_usd` columns are denominated in the market's quote stablecoin.

## Notes

* `market_trades` has both legs of every match. Filter `is_taker AND fill_type = 'trade'` to count each trade once. Summing `amount_usd` over all rows double-counts volume.
* For volume at hourly or coarser grain, use `open_interest_hourly` (per market) or `ohlcv_hourly` (per outcome token). They already count each trade once and match the taker-filtered trades exactly, but scan far fewer rows.
* `ohlcv_hourly` has one candle per outcome token, so each market has two price series. To get the Yes series, filter `outcome_index = 0`.
* `open_interest_hourly` and `positions_daily` are built from the full token ledger (splits, merges, negations and settlements, not only trades). They exclude the venue's settlement counterparty (`is_system_account`).
* About a fifth of markets were listed before the venue published a market registry. Those markets have a null `template` and `title`. They are real markets, not an ingestion gap.
* HIP-4 is not yet part of the cross-venue [`prediction_markets`](/data-catalog/curated/prediction-markets/prediction_markets/overview) tables.

## Example query

```sql theme={null}
-- Top HIP-4 markets by traded volume, last 7 days
SELECT
  m.market_id,
  m.title,
  m.event_title,
  m.category,
  SUM(o.volume_usd) AS volume_usd,
  SUM(o.trade_count) AS num_trades
FROM hip4_hyperliquid.open_interest_hourly o
JOIN hip4_hyperliquid.market_details m
  ON m.market_id = o.market_id
WHERE o.block_month >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '7' DAY)
  AND o.hour >= NOW() - INTERVAL '7' DAY
GROUP BY 1, 2, 3, 4
ORDER BY volume_usd DESC
LIMIT 20
```
