hyperliquid-position-csv

Zero-dependency JavaScript (ESM + CLI) library to reconstruct flat-to-flat perpetual position cycles from Hyperliquid public userFills and export clean CSVs.

Why Position Cycle Reconstruction Matters

Hyperliquid’s public Info endpoint returns up to 2,000 individual execution fills per wallet. Grouping partial maker/taker fills into flat-to-flat cycles (0 → position → 0) using 18-decimal BigInt arithmetic produces accurate volume-weighted entry/exit prices, realized PnL, fee totals, and explicit flags when a position opened before the loaded history window.

CLI & ESM Quick Start

# Export any public 0x wallet's perpetual position cycles to CSV
node ./bin/cli.mjs 0x... --out positions.csv

Related Live Tools & Technical Guides

MIT License · Maintained by HoldWins (English)