$npx -y skills add himself65/finance-skills --skill hyperliquid-readerRead Hyperliquid (app.hyperliquid.xyz) perp + spot market data via opencli (read-only, public info API). Use whenever the user wants Hyperliquid perpetual or spot markets, mark/oracle/mid prices, 24h change, funding rates (hourly or annualized APR), open interest, volume, the L2
| 1 | # Hyperliquid Reader (Read-Only) |
| 2 | |
| 3 | Reads [Hyperliquid](https://app.hyperliquid.xyz) — the on-chain perps/spot DEX — for market data via [opencli](https://github.com/jackwener/opencli) and the `hyperliquid` plugin in this repo's [`opencli-plugins/hyperliquid`](https://github.com/himself65/finance-skills/tree/main/opencli-plugins/hyperliquid) tree (a separate plugin from opencli's built-in adapters, installed via opencli's monorepo subpath syntax). |
| 4 | |
| 5 | **This skill is read-only and market-data only.** It reads Hyperliquid's fully public info API for analysis: market tables, funding, order book, and candles. It does NOT read individual accounts, place/modify/cancel orders, or move funds. There is no trading path in the plugin — order placement requires wallet-signed actions on a separate endpoint this adapter never calls. |
| 6 | |
| 7 | **How it works**: every command issues a single `POST https://api.hyperliquid.xyz/info` with a `{ "type": "..." }` body and normalizes the response. **No API key, no wallet, no login, no running app** — the info API is public. |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## Step 1: Ensure opencli + Plugin Are Installed and Ready |
| 12 | |
| 13 | **Current environment status:** |
| 14 | |
| 15 | ``` |
| 16 | !`(command -v opencli && opencli hyperliquid markets --coin BTC -f json 2>&1 | head -3 && echo "READY" || echo "SETUP_NEEDED") 2>/dev/null || echo "NOT_INSTALLED"` |
| 17 | ``` |
| 18 | |
| 19 | If the status above shows `READY`, skip to Step 2. Otherwise: |
| 20 | |
| 21 | ### NOT_INSTALLED — Install opencli |
| 22 | |
| 23 | ```bash |
| 24 | npm install -g @jackwener/opencli |
| 25 | ``` |
| 26 | |
| 27 | Requires Node.js >= 22 (built-in `fetch`). |
| 28 | |
| 29 | ### SETUP_NEEDED — Install the Hyperliquid plugin |
| 30 | |
| 31 | The Hyperliquid adapter is **not** built into opencli — it's a separate plugin: |
| 32 | |
| 33 | ```bash |
| 34 | opencli plugin install github:himself65/finance-skills/hyperliquid |
| 35 | ``` |
| 36 | |
| 37 | That's the entire setup — no auth, no launch step. Verify with `opencli hyperliquid markets --coin BTC`. |
| 38 | |
| 39 | ### Common setup issues |
| 40 | |
| 41 | | Symptom | Fix | |
| 42 | |---|---| |
| 43 | | `opencli: command not found` | `npm install -g @jackwener/opencli` (Node ≥ 22) | |
| 44 | | `Unknown command: hyperliquid` | `opencli plugin install github:himself65/finance-skills/hyperliquid` | |
| 45 | | `hyperliquid info 429` | Rate limited — wait a few seconds and retry | |
| 46 | |
| 47 | --- |
| 48 | |
| 49 | ## Step 2: Identify What the User Needs |
| 50 | |
| 51 | | User Request | Command | Key Flags | |
| 52 | |---|---|---| |
| 53 | | Perp markets overview / top by volume | `opencli hyperliquid markets` | `--sort`, `--limit`, `--coin` | |
| 54 | | One perp's price + funding + OI | `opencli hyperliquid markets --coin BTC` | — | |
| 55 | | Spot pairs overview | `opencli hyperliquid spot-markets` | `--sort`, `--limit`, `--pair`, `--canonical-only` | |
| 56 | | All current mid prices | `opencli hyperliquid mids` | `--coin <substring>` | |
| 57 | | Order book for a coin | `opencli hyperliquid book --coin ETH` | `--depth`, `--n-sig-figs` | |
| 58 | | OHLCV candles | `opencli hyperliquid candles --coin BTC --interval 1h` | `--limit` | |
| 59 | | Historical funding for a coin | `opencli hyperliquid funding-history --coin BTC` | `--hours`, `--limit` | |
| 60 | | Funding arb: HL vs Binance vs Bybit | `opencli hyperliquid funding-compare` | `--coin`, `--sort`, `--limit` | |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ## Step 3: Execute the Command |
| 65 | |
| 66 | ### General pattern |
| 67 | |
| 68 | ```bash |
| 69 | # Use -f json or -f yaml for structured output |
| 70 | opencli hyperliquid markets --sort fundingAprPct --limit 15 -f json |
| 71 | opencli hyperliquid funding-compare --sort hlVsBinancePct --limit 20 -f md |
| 72 | opencli hyperliquid candles --coin BTC --interval 4h --limit 50 -f csv |
| 73 | opencli hyperliquid book --coin ETH --depth 5 -f json |
| 74 | ``` |
| 75 | |
| 76 | ### Key rules |
| 77 | |
| 78 | 1. **Coin symbols are bare perp names** — `BTC`, `ETH`, `SOL`, `HYPE` (no exchange prefix). Spot pairs are `BASE/USDC` (e.g. `PURR/USDC`); for `book`/`candles` you can pass either a perp coin or a spot pair. |
| 79 | 2. **`markets` is the default lens for "how is X / the market doing"** — it carries mark/oracle/mid price, 24h change, hourly funding + APR, open interest (coins and notional), and 24h volume in one row per perp. Filter with `--coin` for a single asset. |
| 80 | 3. **Funding is reported two ways** — `fundingHrPct` is the raw hourly rate as a percent; `fundingAprPct` annualizes it (`hourly × 24 × 365`). Lead with APR when comparing carry across assets; use the hourly figure for "what will I pay next hour". |