$npx -y skills add franalgaba/grimoire --skill grimoire-hyperliquidQueries Hyperliquid market data using the Grimoire venue CLI. Use when you need mids, books, metadata, open orders, or a withdrawal call.
| 1 | # Grimoire Hyperliquid Skill |
| 2 | |
| 3 | Use this skill for Hyperliquid metadata snapshots and, when explicitly requested, withdrawals. |
| 4 | |
| 5 | Preferred invocations: |
| 6 | |
| 7 | - `grimoire venue hyperliquid ...` |
| 8 | - `npx -y @grimoirelabs/cli venue hyperliquid ...` (no-install) |
| 9 | - `bun run packages/cli/src/index.ts venue hyperliquid ...` (repo-local) |
| 10 | - `grimoire-hyperliquid ...` (direct binary from `@grimoirelabs/venues`) |
| 11 | |
| 12 | Recommended preflight: |
| 13 | |
| 14 | - `grimoire venue doctor --adapter hyperliquid --json` |
| 15 | - Ensure `HYPERLIQUID_PRIVATE_KEY` is set before stateful actions (`withdraw`). |
| 16 | |
| 17 | Use `--format spell` for snapshot `params:` blocks. |
| 18 | |
| 19 | ## Commands |
| 20 | |
| 21 | Read-only data: |
| 22 | |
| 23 | - `grimoire venue hyperliquid mids` — mid prices for all perp assets |
| 24 | - `grimoire venue hyperliquid l2-book --coin <symbol>` — L2 order book for a coin |
| 25 | - `grimoire venue hyperliquid open-orders --user <address>` — open orders for an address |
| 26 | - `grimoire venue hyperliquid meta` — perp market metadata (universe, margin tables) |
| 27 | - `grimoire venue hyperliquid spot-meta` — spot market metadata (tokens, universe) |
| 28 | |
| 29 | Snapshot commands (agent-only, generate spell `params:` blocks): |
| 30 | |
| 31 | - `grimoire venue hyperliquid mids-snapshot` |
| 32 | - `grimoire venue hyperliquid l2-book-snapshot --coin <symbol>` |
| 33 | - `grimoire venue hyperliquid open-orders-snapshot --user <address>` |
| 34 | - `grimoire venue hyperliquid meta-snapshot` |
| 35 | - `grimoire venue hyperliquid spot-meta-snapshot` |
| 36 | |
| 37 | Stateful: |
| 38 | |
| 39 | - `grimoire venue hyperliquid withdraw --amount <usdc> --keystore <path> [--password-env <name>] [--destination <addr>]` |
| 40 | |
| 41 | ## Examples |
| 42 | |
| 43 | ```bash |
| 44 | grimoire venue hyperliquid mids --format table |
| 45 | grimoire venue hyperliquid mids --format spell |
| 46 | grimoire venue hyperliquid l2-book --coin BTC |
| 47 | grimoire venue hyperliquid l2-book --coin BTC --format spell |
| 48 | grimoire venue hyperliquid open-orders --user 0x0000000000000000000000000000000000000000 |
| 49 | grimoire venue hyperliquid meta |
| 50 | grimoire venue hyperliquid mids-snapshot |
| 51 | grimoire venue hyperliquid l2-book-snapshot --coin BTC |
| 52 | grimoire venue hyperliquid meta-snapshot |
| 53 | ``` |
| 54 | |
| 55 | Use `-snapshot` variants to emit `params:` blocks for spell inputs. These are agent-only (output suppressed in interactive mode). |
| 56 | |
| 57 | ## Spell Actions |
| 58 | |
| 59 | Hyperliquid uses `custom` action type with `op: "order"` for order placement: |
| 60 | |
| 61 | ```spell |
| 62 | hyperliquid.custom(op="order", coin="ETH", price="3500", size="0.1", side="buy", order_type="Gtc") |
| 63 | ``` |
| 64 | |
| 65 | The adapter does not support runtime constraints (`max_slippage`, etc.). Order parameters are validated at the adapter boundary. |
| 66 | |
| 67 | Supported TIF values: `Gtc`, `Ioc`, `Alo`, `FrontendMarket`. |
| 68 | |
| 69 | ## Metric Surface (Spell Comparisons) |
| 70 | |
| 71 | Hyperliquid exposes `mid_price` for symbol midpoint comparisons: |
| 72 | |
| 73 | ```spell |
| 74 | hl_mid = metric("mid_price", hyperliquid, ETH) |
| 75 | ``` |
| 76 | |
| 77 | The third argument is the Hyperliquid symbol to read (for example `ETH`, `BTC`, `SOL`). |
| 78 | |
| 79 | ## Notes |
| 80 | |
| 81 | - `withdraw` is stateful and requires explicit user confirmation plus keystore credentials. |
| 82 | - `mids`, `l2-book`, `open-orders`, `meta`, `spot-meta` are read-only info calls. |
| 83 | - Use `--format spell` for snapshot-based spell inputs. |
| 84 | - Use `--format json` for `meta`/`spot-meta` in automation; `--format table` shows compact summaries for nested payloads. |
| 85 | - `anvil`/`cast` are EVM tools and are not applicable for Hyperliquid execution/diagnostics. |