Skip to main content

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.

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.
To filter to currently-open positions use WHERE NOT is_tombstone. Use last_activity_timestamp rather than time_slice for freshness.

Table Columns

Identifiers

Column NameDescription
time_sliceCalendar day for this row.
userUser wallet address.
typePosition type. Currently ‘oneWay’.
coinCoin of the position.
timestampEnd-of-day timestamp (midnight TIMESTAMP_NTZ).
last_activity_timestampSub-second timestamp of the most recent observed activity for this (user, type, coin).
is_tombstoneTrue when the position for this day is known to be closed. Use WHERE NOT is_tombstone to filter to open positions.
closure_tsFor tombstone rows, the earliest fill timestamp at which the position reached zero. NULL otherwise.
_created_atRow creation timestamp.
_updated_atRow last update timestamp.

Position

Column NameDescription
sziSize of the position. ‘0’ on tombstone rows.
leverage_typeType of leverage. NULL on tombstone rows.
leverage_valueLeverage multiplier. NULL on tombstone rows.
entry_pxEntry price. NULL on tombstone rows.
position_valuePosition value. Zeroed on tombstone rows.
unrealized_pnlUnrealized PnL. Zeroed on tombstone rows.
return_on_equityReturn on equity. Zeroed on tombstone rows.
liquidation_pricePrice that would trigger liquidation. NULL on tombstone rows.
margin_usedMargin used. Zeroed on tombstone rows.
max_leverageMaximum leverage allowed. NULL on tombstone rows.

Funding

Column NameDescription
cumulative_funding_all_timeCumulative funding paid / received all time. NULL on tombstone rows.
cumulative_funding_since_openCumulative funding paid / received since the position was opened. Zeroed on tombstone rows.
cumulative_funding_since_changeCumulative funding paid / received since the last position change. Zeroed on tombstone rows.

Sample Query

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