> ## 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.

# hip4_hyperliquid.positions_daily

> Hyperliquid HIP-4 daily positions — end-of-day balance and value per account and outcome token.

export const TableSample = ({tableName, tableSchema}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}&darkMode=true`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
  </>;

The `hip4_hyperliquid.positions_daily` table shows what every account holds on Hyperliquid HIP-4 markets, day by day, and what it is worth. Grain: one row per `(day, trader, outcome_id)`. Rows run from the day a position opens to the day it closes or the market settles.

A day on which the balance does not change carries the previous balance forward, so a position appears on every day it was open. An account holding nothing has no row. Balances are read from the fill ledger, including splits, merges, negations and settlements, not only trades. The current day is added once it closes.

This table has balances and prices only. For what the market asks and how it resolved, join [`hip4_hyperliquid.market_details`](/data-catalog/curated/prediction-markets/hip4/market_details) on `market_id`. For the full price history, join [`hip4_hyperliquid.ohlcv_hourly`](/data-catalog/curated/prediction-markets/hip4/ohlcv_hourly) on `outcome_id`.

## Table Schema

| Column                 | Type        | Description                                                                                                                      |
| ---------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `block_month`          | `DATE`      | First day of the UTC month of `day`. Partition key                                                                               |
| `day`                  | `DATE`      | UTC day the holding describes. Balances are as of the end of the day                                                             |
| `trader`               | `VARBINARY` | Account holding the tokens                                                                                                       |
| `market_id`            | `VARCHAR`   | Market the held token belongs to. Joins `hip4_hyperliquid.market_details`                                                        |
| `outcome_id`           | `VARCHAR`   | Outcome token held                                                                                                               |
| `outcome_index`        | `INTEGER`   | Side held: `0` is Yes, `1` is No                                                                                                 |
| `balance`              | `DOUBLE`    | Outcome tokens held at the end of the day. Always positive                                                                       |
| `price`                | `DOUBLE`    | End-of-day price of the token held, in the quote stablecoin, 0 to 1. Not always the Yes price. NULL until the token first trades |
| `balance_usd`          | `DOUBLE`    | End-of-day value of the holding in the quote stablecoin. NULL wherever `price` is                                                |
| `_position_updated_at` | `TIMESTAMP` | When the balance last changed. Earlier than `day` where the position was carried through days with no activity                   |
| `_updated_at`          | `TIMESTAMP` | When this row was last written by the pipeline                                                                                   |

## Table sample

<TableSample tableSchema="hip4_hyperliquid" tableName="positions_daily" />

## Query performance

`block_month` is the partition key. Always include a `block_month` or `day` filter.

## Example query

```sql theme={null}
-- Largest holders of a market yesterday
SELECT
  trader,
  CASE outcome_index WHEN 0 THEN 'Yes' ELSE 'No' END AS side,
  balance,
  price,
  balance_usd
FROM hip4_hyperliquid.positions_daily
WHERE market_id = '1473'
  AND block_month = DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1' DAY)
  AND day = CURRENT_DATE - INTERVAL '1' DAY
ORDER BY balance_usd DESC
LIMIT 20
```
