hyperliquid-reader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHyperliquid Reader (Read-Only)
Hyperliquid 数据读取工具(只读)
Reads Hyperliquid — the on-chain perps/spot DEX — for market data via opencli and the plugin in this repo's tree (a separate plugin from opencli's built-in adapters, installed via opencli's monorepo subpath syntax).
hyperliquidopencli-plugins/hyperliquidThis 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.
How it works: every command issues a single with a body and normalizes the response. No API key, no wallet, no login, no running app — the info API is public.
POST https://api.hyperliquid.xyz/info{ "type": "..." }通过opencli及本仓库目录下的插件(与opencli内置适配器分离的独立插件,通过opencli的单仓库子路径语法安装),读取链上永续/现货DEX Hyperliquid的市场数据。
opencli-plugins/hyperliquidhyperliquid本工具为只读工具,仅提供市场数据。它读取Hyperliquid完全公开的信息API用于分析:市场表格、资金费率、订单簿和蜡烛图。它不会读取个人账户信息,也不会下单/修改订单/取消订单或转移资金。插件中没有交易相关路径——下单需要钱包签名操作,而本适配器绝不会调用相关端点。
工作原理:每个命令都会发送一个请求,请求体为,并对响应进行标准化处理。无需API密钥、钱包、登录或运行应用——该信息API是公开的。
POST https://api.hyperliquid.xyz/info{ "type": "..." }Step 1: Ensure opencli + Plugin Are Installed and Ready
步骤1:确保opencli及插件已安装并就绪
Current environment status:
!`(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"`If the status above shows , skip to Step 2. Otherwise:
READY当前环境状态:
!`(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"`如果上述状态显示,则跳至步骤2。否则:
READYNOT_INSTALLED — Install opencli
NOT_INSTALLED — 安装opencli
bash
npm install -g @jackwener/opencliRequires Node.js >= 24 — the plugin declares .
hyperliquidengines.node >= 24bash
npm install -g @jackwener/opencli需要Node.js ≥ 24版本——插件声明。
hyperliquidengines.node >= 24SETUP_NEEDED — Install the Hyperliquid plugin
SETUP_NEEDED — 安装Hyperliquid插件
The Hyperliquid adapter is not built into opencli — it's a separate plugin:
bash
opencli plugin install github:himself65/finance-skills/hyperliquidThat's the entire setup — no auth, no launch step. Verify with .
opencli hyperliquid markets --coin BTCHyperliquid适配器未内置在opencli中,它是一个独立插件:
bash
opencli plugin install github:himself65/finance-skills/hyperliquid安装完成即完成全部设置——无需认证,无需启动步骤。可通过验证安装。
opencli hyperliquid markets --coin BTCCommon setup issues
常见设置问题
| Symptom | Fix |
|---|---|
| |
| |
| Rate limited — wait a few seconds and retry |
| 症状 | 解决方法 |
|---|---|
| 执行 |
| 执行 |
| 触发速率限制——等待几秒后重试 |
Step 2: Identify What the User Needs
步骤2:明确用户需求
| User Request | Command | Key Flags |
|---|---|---|
| Perp markets overview / top by volume | | |
| One perp's price + funding + OI | | — |
| Spot pairs overview | | |
| All current mid prices | | |
| Order book for a coin | | |
| OHLCV candles | | |
| Historical funding for a coin | | |
| Funding arb: HL vs Binance vs Bybit | | |
| 用户请求 | 命令 | 关键参数 |
|---|---|---|
| 永续合约市场概览 / 按交易量排序 | | |
| 单个永续合约的价格 + 资金费率 + 持仓量 | | — |
| 现货交易对概览 | | |
| 所有当前中间价 | | |
| 某币种的订单簿 | | |
| OHLCV蜡烛图 | | |
| 某币种的历史资金费率 | | |
| 资金费率套利:HL vs Binance vs Bybit | | |
Step 3: Execute the Command
步骤3:执行命令
General pattern
通用格式
bash
undefinedbash
undefinedUse -f json or -f yaml for structured output
使用-f json或-f yaml获取结构化输出
opencli hyperliquid markets --sort fundingAprPct --limit 15 -f json
opencli hyperliquid funding-compare --sort hlVsBinancePct --limit 20 -f md
opencli hyperliquid candles --coin BTC --interval 4h --limit 50 -f csv
opencli hyperliquid book --coin ETH --depth 5 -f json
undefinedopencli hyperliquid markets --sort fundingAprPct --limit 15 -f json
opencli hyperliquid funding-compare --sort hlVsBinancePct --limit 20 -f md
opencli hyperliquid candles --coin BTC --interval 4h --limit 50 -f csv
opencli hyperliquid book --coin ETH --depth 5 -f json
undefinedKey rules
核心规则
- Coin symbols are bare perp names — ,
BTC,ETH,SOL(no exchange prefix). Spot pairs areHYPE(e.g.BASE/USDC); forPURR/USDC/bookyou can pass either a perp coin or a spot pair.candles - 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
marketsfor a single asset.--coin - Funding is reported two ways — is the raw hourly rate as a percent;
fundingHrPctannualizes it (fundingAprPct). Lead with APR when comparing carry across assets; use the hourly figure for "what will I pay next hour".hourly × 24 × 365 - is the funding-arb screen — it annualizes each venue with its own interval (HL hourly, Binance/Bybit usually 4h) and reports
funding-compare/hlVsBinancePctspreads. Default sort ranks by absolute HL-vs-Binance spread (widest dislocations first). A positivehlVsBybitPctmeans HL longs pay more than Binance longs.hlVsBinancePct - defaults to 10 levels per side — raise
book(max 20) for more, or--depthto aggregate price levels. Compute the spread/mid from the top bid and ask.--n-sig-figs 2..5 - pulls the most recent
candlescandles of--limit(default--interval, 100 candles). Valid intervals:1h. Max 5000.1m 3m 5m 15m 30m 1h 2h 4h 8h 12h 1d 3d 1w 1M - for programmatic processing / feeding other skills;
-f jsonor-f mdfor human-readable output.-f table - NEVER call any write operation. This skill is read-only market data — no account reads, no order placement, modification, or cancellation, and no transfers. The plugin intentionally exposes no write endpoints.
- 币种符号为纯永续合约名称——、
BTC、ETH、SOL(无需交易所前缀)。现货交易对格式为HYPE(例如BASE/USDC);对于PURR/USDC/book命令,可传入永续合约币种或现货交易对。candles - 是查询「某币种/整体市场表现」的默认入口——每条记录包含标记价格/预言机价格/中间价、24小时涨跌幅、小时资金费率+年化费率、持仓量(币种数量和名义价值)、24小时交易量。可通过
markets筛选单个资产。--coin - 资金费率有两种展示方式——为原始小时费率(百分比);
fundingHrPct为年化费率(fundingAprPct)。跨资产对比持仓成本时优先使用年化费率;查询「下一小时需支付/收取的费用」时使用小时费率。小时费率 × 24 × 365 - 是资金费率套利筛选工具——它会根据各平台的间隔(HL为小时级,Binance/Bybit通常为4小时级)计算年化费率,并展示
funding-compare/hlVsBinancePct差值。默认按HL与Binance的绝对差值排序(差值最大的排在最前)。hlVsBybitPct为正值意味着HL多头支付的费率高于Binance多头。hlVsBinancePct - 默认展示每侧10档深度——可提高
book参数(最大20)查看更多档位,或使用--depth合并价格档位。可根据最优买价和最优卖价计算点差/中间价。--n-sig-figs 2..5 - 获取最近
candles根--limit周期的蜡烛图(默认--interval周期,100根蜡烛)。支持的周期:1h。最大支持5000根。1m 3m 5m 15m 30m 1h 2h 4h 8h 12h 1d 3d 1w 1M - 适用于程序化处理/为其他工具提供数据;
-f json或-f md适用于人类可读输出。-f table - 切勿调用任何写入操作。本工具仅提供只读市场数据——不读取账户信息,不下单、修改订单、取消订单,也不进行转账。插件故意不暴露任何写入端点。
Output format flag (-f
)
-f输出格式参数(-f
)
-f| Format | Flag | Best for |
|---|---|---|
| Table | | Human-readable terminal output |
| JSON | | Programmatic processing, LLM context |
| YAML | | Structured, readable |
| Markdown | | Reports |
| CSV | | Spreadsheet export |
| 格式 | 参数 | 最佳适用场景 |
|---|---|---|
| 表格 | | 终端可读输出 |
| JSON | | 程序化处理、LLM上下文 |
| YAML | | 结构化可读输出 |
| Markdown | | 报告文档 |
| CSV | | 导出至电子表格 |
Output columns
输出列
- —
markets,coin,markPx,midPx,oraclePx,change24hPct,fundingHrPct,fundingAprPct,openInterest,oiNotional,dayNtlVlm,premiumPctmaxLeverage - —
spot-markets,pair,base,markPx,midPx,change24hPct,dayNtlVlm,circulatingSupply,marketCapcanonical - —
mids,coinmid - —
book,side,level,px,szorders - —
candles,time,open,high,low,close,volumetrades - —
funding-history,coin,fundingRatePct,fundingAprPct,premiumPcttime - —
funding-compare,coin,hlAprPct,binanceAprPct,bybitAprPct,hlVsBinancePct,hlVsBybitPctnextHlFunding
- —
markets、coin、markPx、midPx、oraclePx、change24hPct、fundingHrPct、fundingAprPct、openInterest、oiNotional、dayNtlVlm、premiumPctmaxLeverage - —
spot-markets、pair、base、markPx、midPx、change24hPct、dayNtlVlm、circulatingSupply、marketCapcanonical - —
mids、coinmid - —
book、side、level、px、szorders - —
candles、time、open、high、low、close、volumetrades - —
funding-history、coin、fundingRatePct、fundingAprPct、premiumPcttime - —
funding-compare、coin、hlAprPct、binanceAprPct、bybitAprPct、hlVsBinancePct、hlVsBybitPctnextHlFunding
Step 4: Present the Results
步骤4:展示结果
- Lead with the headline number, then the table. For : state mark price, 24h change, funding APR, and open interest in prose first. For a full
markets --coin BTCdump: lead with the count and the top movers / highest-funding names.markets - Frame funding in carry terms — e.g. "BTC perp funding is +10.9% APR (longs pay shorts)". Positive funding ⇒ longs pay shorts; negative ⇒ shorts pay longs.
- For , surface the widest dislocations first — name the coin, both venues' APRs, and the spread, and remember the spread is annualized; a real arb also pays exchange/withdrawal frictions, so present it as a screen, not a guaranteed edge.
funding-compare - For , report the spread — best bid, best ask, mid, and spread in bps before (or instead of) dumping every level. Don't paste 20 levels unless asked.
book - For , describe the move — first/last close, high/low, and direction; only show the full OHLCV table when the user wants the series.
candles - Filter aggressively before showing — has ~180 perps and
markets~700 markets; cap to top 15-20 by the relevant sort unless the user asks for the full list.mids - Cross-reference for trade decisions — Hyperliquid is the on-chain venue; for equities/options context pair it with the or
funda-dataskills. For funding/basis trades,tradingview-readerplusfunding-compare(premium, OI) is the core view.markets
- 先展示核心数据,再展示表格。例如查询时:先以文字形式说明标记价格、24小时涨跌幅、资金年化费率和持仓量。若查询完整
markets --coin BTC列表:先说明总数,再展示涨幅最大/资金费率最高的币种。markets - 从持仓成本角度描述资金费率——例如「BTC永续合约资金费率为+10.9%年化(多头支付给空头)」。正资金费率⇒多头支付给空头;负资金费率⇒空头支付给多头。
- 对于,优先展示差值最大的币种——说明币种名称、两个平台的年化费率及差值,注意差值是年化的;实际套利还需考虑交易所/提现成本,因此仅作为筛选工具,而非绝对套利机会。
funding-compare - 对于,先报告点差——最优买价、最优卖价、中间价及点差(基点),除非用户要求,否则无需展示所有档位。
book - 对于,描述价格走势——开盘价/收盘价、最高价/最低价及趋势;仅当用户需要完整序列时才展示OHLCV表格。
candles - 展示前严格筛选——包含约180个永续合约,
markets包含约700个市场;除非用户要求完整列表,否则按相关排序保留前15-20条。mids - 为交易决策提供交叉参考——Hyperliquid是链上平台;若需股票/期权相关信息,可搭配或
funda-data工具。对于资金费率/基差交易,tradingview-reader搭配funding-compare(溢价、持仓量)是核心视图。markets
Step 5: Diagnostics
步骤5:诊断测试
bash
opencli hyperliquid markets --coin BTCA successful BTC row confirms opencli, the plugin, and the public API are all reachable. If it errors with , reinstall the plugin (Step 1). A is an upstream API issue — retry after a short wait.
Unknown command: hyperliquidhyperliquid info 4xx/5xxbash
opencli hyperliquid markets --coin BTC成功返回BTC数据行说明opencli、插件及公共API均可正常访问。若报错,请重新安装插件(步骤1)。若出现错误,属于上游API问题——等待片刻后重试。
Unknown command: hyperliquidhyperliquid info 4xx/5xxError Reference
错误参考
| Error | Cause | Fix |
|---|---|---|
| Plugin not installed | |
| Rate limited | Wait a few seconds, then retry |
| Malformed body or upstream issue | Re-check the coin/interval; retry after a wait |
| Wrong/unlisted symbol | Run |
| 错误 | 原因 | 解决方法 |
|---|---|---|
| 未安装插件 | 执行 |
| 触发速率限制 | 等待几秒后重试 |
| 请求体格式错误或上游问题 | 检查币种/周期参数;等待片刻后重试 |
| 符号错误/未上市 | 执行 |
Reference Files
参考文件
- — Every command with all flags, output schemas, and analyst workflows (funding carry, basis/arb, spot snapshot)
references/commands.md
- — 包含所有命令、参数、输出 schema 及分析师工作流(资金持仓成本、基差/套利、现货快照)
references/commands.md