hyperliquid.assets.perpetual_positions_latest view contains the latest perpetual position per (user, type, coin) on Hyperliquid. Every row represents a currently-open position.
Table Details
| Property | Value |
|---|---|
| Table Name | hyperliquid.assets.perpetual_positions_latest |
| Table Status | Production-Ready |
| Unique Key | user, type, coin |
Use
last_activity_timestamp for freshness checks.Table Columns
Identifiers
| Column Name | Data Type | Description |
|---|---|---|
| user | VARCHAR(16777216) | User wallet address. |
| type | VARCHAR(16777216) | Position type. Currently ‘oneWay’. |
| coin | VARCHAR(16777216) | Coin of the position. |
| szi | VARCHAR(16777216) | Size of the position. |
| leverage_type | VARCHAR(16777216) | Type of leverage used (e.g. ‘cross’, ‘isolated’). |
| leverage_value | NUMBER(38,0) | Leverage multiplier. |
| entry_px | VARCHAR(16777216) | Entry price. |
| position_value | VARCHAR(16777216) | Position value. |
| unrealized_pnl | VARCHAR(16777216) | Unrealized PnL. |
| return_on_equity | VARCHAR(16777216) | Return on equity. |
| liquidation_price | VARCHAR(16777216) | Price that would trigger liquidation. |
| margin_used | VARCHAR(16777216) | Margin used to maintain the position. |
| max_leverage | NUMBER(38,0) | Maximum leverage allowed for this position. |
| cumulative_funding_all_time | VARCHAR(16777216) | Cumulative funding paid / received all time. |
| cumulative_funding_since_open | VARCHAR(16777216) | Cumulative funding paid / received since the position was opened. |
| cumulative_funding_since_change | VARCHAR(16777216) | Cumulative funding paid / received since the last position change. |
| last_activity_timestamp | TIMESTAMP_NTZ(9) | Sub-second timestamp of the most recent observed activity for this (user, type, coin). |
| block_date | TIMESTAMP_NTZ(9) | Calendar date for this row (midnight UTC). |
| _created_at | TIMESTAMP_NTZ(9) | Row creation timestamp. |
| _updated_at | TIMESTAMP_NTZ(9) | Row last update timestamp. |
Position
| Column Name | Description | |
|---|---|---|
| szi | Size of the position. | The size of the position. |
| leverage_type | Type of leverage used (e.g. ‘cross’, ‘isolated’). | The type of leverage used for this position. |
| leverage_value | Leverage multiplier. | The leverage multiplier used for this position. |
| entry_px | Entry price. | The entry price of the position. |
| position_value | Position value. | The position value. |
| unrealized_pnl | Unrealized PnL. | The unrealized PnL of the position. |
| return_on_equity | Return on equity. | The return on equity of the position. |
| liquidation_price | Price that would trigger liquidation. | The price which will trigger a liquidation of the position. |
| margin_used | Margin used to maintain the position. | The margin used to maintain the position. |
| max_leverage | Maximum leverage allowed for this position. | Maximum leverage allowed for this position at the snapshot. Usually matches the market cap at that time. The user’s selected leverage is leverage_value. |
Funding
| Column Name | Description | |
|---|---|---|
| cumulative_funding_all_time | Cumulative funding paid / received all time. | The cumulative funding paid/received all time. |
| cumulative_funding_since_open | Cumulative funding paid / received since the position was opened. | The cumulative funding paid/received since the position was opened. |
| cumulative_funding_since_change | Cumulative funding paid / received since the last position change. | The cumulative funding paid/received since the last position change. |
Sample Query
SELECT
user,
coin,
szi,
position_value,
unrealized_pnl,
last_activity_timestamp
FROM hyperliquid.assets.perpetual_positions_latest
WHERE coin = 'BTC'
ORDER BY ABS(position_value::float) DESC
LIMIT 100