Skip to main content
The hyperliquid.assets.perpetual_closed_positions view contains one row per completed perpetual position, from flat back to flat, for native Hyperliquid perps and HIP-3 perps. Spot markets, HIP-4, positions still open, positions opened before coverage start, positions whose size changes between two fills without a fill, and positions that include a timestamp whose fills do not form one position path (for example duplicated fills) are not included. Fills that share a timestamp have no execution order, so positions are cut on the position size at the end of each timestamp. Round trips that start and end flat inside one timestamp become one row per side. A close and reopen on the same side inside one timestamp stays one row. gross_realized_pnl, total_fees, total_funding, and net_realized_pnl are denominated in the market’s collateral token. Do not treat those columns as USD unless the collateral token is a dollar stablecoin at peg. Matching *_usd columns convert each fill or funding event at the collateral token’s 5-minute USD price. When any contributing event lacks a price, the affected USD columns are null, net_usd_is_complete is false, and unpriced_component_count records the unpriced fill and funding events. net_realized_pnl equals gross_realized_pnl - total_fees + total_funding. The exchange fee field already includes builder and HIP-3 deployer fees. Flip fills allocate fee by segment size so allocated fees sum to the raw fee. Funding is attributed on [open_time, close_time). Coverage starts at 2025-06-05 00:00:00 UTC.
Always filter with WHERE user = .... A query without a user filter reconstructs every wallet and is slow.

Table Details

Sample Query