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

# Perpetual Positions Daily

> Daily perpetual positions on Hyperliquid per (user, type, coin).

The `hyperliquid.assets.perpetual_positions_daily` view contains daily Hyperliquid perpetual position state per (user, type, coin). Days where the position is known to be closed are flagged via `is_tombstone = true`.

<Info>
  To filter to currently-open positions use `WHERE NOT is_tombstone`. Use `last_activity_timestamp` rather than `time_slice` for freshness.
</Info>

## Table Columns

### Identifiers

| Column Name               | Description                                                                                                          |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| time\_slice               | Calendar day for this row.                                                                                           |
| user                      | User wallet address.                                                                                                 |
| type                      | Position type. Currently 'oneWay'.                                                                                   |
| coin                      | Coin of the position.                                                                                                |
| timestamp                 | End-of-day timestamp (midnight TIMESTAMP\_NTZ).                                                                      |
| last\_activity\_timestamp | Sub-second timestamp of the most recent observed activity for this (user, type, coin).                               |
| is\_tombstone             | True when the position for this day is known to be closed. Use `WHERE NOT is_tombstone` to filter to open positions. |
| closure\_ts               | For tombstone rows, the earliest fill timestamp at which the position reached zero. NULL otherwise.                  |
| \_created\_at             | Row creation timestamp.                                                                                              |
| \_updated\_at             | Row last update timestamp.                                                                                           |

### Position

| Column Name        | Description                                                   |
| ------------------ | ------------------------------------------------------------- |
| szi                | Size of the position. '0' on tombstone rows.                  |
| leverage\_type     | Type of leverage. NULL on tombstone rows.                     |
| leverage\_value    | Leverage multiplier. NULL on tombstone rows.                  |
| entry\_px          | Entry price. NULL on tombstone rows.                          |
| position\_value    | Position value. Zeroed on tombstone rows.                     |
| unrealized\_pnl    | Unrealized PnL. Zeroed on tombstone rows.                     |
| return\_on\_equity | Return on equity. Zeroed on tombstone rows.                   |
| liquidation\_price | Price that would trigger liquidation. NULL on tombstone rows. |
| margin\_used       | Margin used. Zeroed on tombstone rows.                        |
| max\_leverage      | Maximum leverage allowed. NULL on tombstone rows.             |

### Funding

| Column Name                        | Description                                                                                  |
| ---------------------------------- | -------------------------------------------------------------------------------------------- |
| cumulative\_funding\_all\_time     | Cumulative funding paid / received all time. NULL on tombstone rows.                         |
| cumulative\_funding\_since\_open   | Cumulative funding paid / received since the position was opened. Zeroed on tombstone rows.  |
| cumulative\_funding\_since\_change | Cumulative funding paid / received since the last position change. Zeroed on tombstone rows. |

## Sample Query

```sql theme={null}
SELECT
  time_slice,
  user,
  coin,
  szi,
  position_value,
  unrealized_pnl
FROM hyperliquid.assets.perpetual_positions_daily
WHERE time_slice >= CURRENT_DATE - 7
  AND coin = 'BTC'
  AND NOT is_tombstone
ORDER BY time_slice DESC, ABS(position_value::float) DESC
LIMIT 100
```
