Hyperliquid Trading
Requires: hl CLI on PATH (uv tool install hyperliquid-cli). Auth via HL_PRIVATE_KEY env var (API wallet — can trade, cannot withdraw). Read commands work without auth using --address 0x....
Portfolio
hl status— full overview (balance + positions + orders)hl balance— account value, margin used, withdrawablehl positions— open positions with P&L, leverage, liquidation pricehl positions BTC— filter to one assethl orders— open/pending orders
Market Data
hl prices BTC ETH— mid, mark, oracle, 24h changehl prices— all mid priceshl assets— all tradeable perps with volume, OI, fundinghl assets TSLA— search by name (auto-resolves HIP-3 names)hl assets --sort volume— sort by volume, oi, or namehl book BTC --depth 10— order book levelshl funding BTC— current funding ratehl funding BTC --history --limit 24— historical fundinghl candles BTC 1h --limit 50— OHLCV (intervals: 1m 5m 15m 1h 4h 1d 1w)
Orders
hl order BTC buy 0.1 95000— limit buyhl order BTC buy 0.1 --market— market buyhl order ETH sell 1.5 --market --reduce-only— close positionhl order BTC buy 0.1 95000 --tp 100000 --sl 90000— limit with TP/SL- Side aliases:
buy/long,sell/short - Asset names auto-resolve (e.g.
TSLAtoxyz:TSLA)
Cancel
hl cancel 77738308— cancel by order IDhl cancel BTC 77738308— cancel with explicit asset (faster)hl cancel-all— cancel all open ordershl cancel-all BTC— cancel only BTC orders
Leverage
hl leverage BTC 10— set cross leveragehl leverage NVDA 5 --isolated— set isolated leverage
Trade History
hl fills— last 20 fills from exchange APIhl fills BTC --limit 50— filter by assethl fills --start 2026-03-10 --end 2026-03-11— time rangehl trades— last 20 from local log (data/trades.jsonl)
All output is JSON to stdout. Use --fields to project specific fields. Global flags (--testnet, --fields, --verbose) go before the subcommand. Exit code 5 means order rejected. Every hl order logs to data/trades.jsonl.