hyperliquid-reader

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hyperliquid Reader (Read-Only)

Hyperliquid 数据读取工具(只读)

Reads Hyperliquid — the on-chain perps/spot DEX — for market data via opencli and the
hyperliquid
plugin in this repo's
opencli-plugins/hyperliquid
tree (a separate plugin from opencli's built-in adapters, installed via opencli's monorepo subpath syntax).
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.
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.

通过opencli及本仓库
opencli-plugins/hyperliquid
目录下的
hyperliquid
插件(与opencli内置适配器分离的独立插件,通过opencli的单仓库子路径语法安装),读取链上永续/现货DEX Hyperliquid的市场数据。
本工具为只读工具,仅提供市场数据。它读取Hyperliquid完全公开的信息API用于分析:市场表格、资金费率、订单簿和蜡烛图。它不会读取个人账户信息,也不会下单/修改订单/取消订单或转移资金。插件中没有交易相关路径——下单需要钱包签名操作,而本适配器绝不会调用相关端点。
工作原理:每个命令都会发送一个
POST https://api.hyperliquid.xyz/info
请求,请求体为
{ "type": "..." }
,并对响应进行标准化处理。无需API密钥、钱包、登录或运行应用——该信息API是公开的。

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
READY
, skip to Step 2. Otherwise:
当前环境状态
!`(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"`
如果上述状态显示
READY
,则跳至步骤2。否则:

NOT_INSTALLED — Install opencli

NOT_INSTALLED — 安装opencli

bash
npm install -g @jackwener/opencli
Requires Node.js >= 24 — the
hyperliquid
plugin declares
engines.node >= 24
.
bash
npm install -g @jackwener/opencli
需要Node.js ≥ 24版本——
hyperliquid
插件声明
engines.node >= 24

SETUP_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/hyperliquid
That's the entire setup — no auth, no launch step. Verify with
opencli hyperliquid markets --coin BTC
.
Hyperliquid适配器未内置在opencli中,它是一个独立插件:
bash
opencli plugin install github:himself65/finance-skills/hyperliquid
安装完成即完成全部设置——无需认证,无需启动步骤。可通过
opencli hyperliquid markets --coin BTC
验证安装。

Common setup issues

常见设置问题

SymptomFix
opencli: command not found
npm install -g @jackwener/opencli
(Node ≥ 24)
Unknown command: hyperliquid
opencli plugin install github:himself65/finance-skills/hyperliquid
hyperliquid info 429
Rate limited — wait a few seconds and retry

症状解决方法
opencli: command not found
执行
npm install -g @jackwener/opencli
(需Node ≥ 24)
Unknown command: hyperliquid
执行
opencli plugin install github:himself65/finance-skills/hyperliquid
hyperliquid info 429
触发速率限制——等待几秒后重试

Step 2: Identify What the User Needs

步骤2:明确用户需求

User RequestCommandKey Flags
Perp markets overview / top by volume
opencli hyperliquid markets
--sort
,
--limit
,
--coin
One perp's price + funding + OI
opencli hyperliquid markets --coin BTC
Spot pairs overview
opencli hyperliquid spot-markets
--sort
,
--limit
,
--pair
,
--canonical-only
All current mid prices
opencli hyperliquid mids
--coin <substring>
Order book for a coin
opencli hyperliquid book --coin ETH
--depth
,
--n-sig-figs
OHLCV candles
opencli hyperliquid candles --coin BTC --interval 1h
--limit
Historical funding for a coin
opencli hyperliquid funding-history --coin BTC
--hours
,
--limit
Funding arb: HL vs Binance vs Bybit
opencli hyperliquid funding-compare
--coin
,
--sort
,
--limit

用户请求命令关键参数
永续合约市场概览 / 按交易量排序
opencli hyperliquid markets
--sort
,
--limit
,
--coin
单个永续合约的价格 + 资金费率 + 持仓量
opencli hyperliquid markets --coin BTC
现货交易对概览
opencli hyperliquid spot-markets
--sort
,
--limit
,
--pair
,
--canonical-only
所有当前中间价
opencli hyperliquid mids
--coin <子字符串>
某币种的订单簿
opencli hyperliquid book --coin ETH
--depth
,
--n-sig-figs
OHLCV蜡烛图
opencli hyperliquid candles --coin BTC --interval 1h
--limit
某币种的历史资金费率
opencli hyperliquid funding-history --coin BTC
--hours
,
--limit
资金费率套利:HL vs Binance vs Bybit
opencli hyperliquid funding-compare
--coin
,
--sort
,
--limit

Step 3: Execute the Command

步骤3:执行命令

General pattern

通用格式

bash
undefined
bash
undefined

Use -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
undefined
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
undefined

Key rules

核心规则

  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.
  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.
  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".
  4. funding-compare
    is the funding-arb screen
    — it annualizes each venue with its own interval (HL hourly, Binance/Bybit usually 4h) and reports
    hlVsBinancePct
    /
    hlVsBybitPct
    spreads. Default sort ranks by absolute HL-vs-Binance spread (widest dislocations first). A positive
    hlVsBinancePct
    means HL longs pay more than Binance longs.
  5. book
    defaults to 10 levels per side
    — raise
    --depth
    (max 20) for more, or
    --n-sig-figs 2..5
    to aggregate price levels. Compute the spread/mid from the top bid and ask.
  6. candles
    pulls the most recent
    --limit
    candles
    of
    --interval
    (default
    1h
    , 100 candles). Valid intervals:
    1m 3m 5m 15m 30m 1h 2h 4h 8h 12h 1d 3d 1w 1M
    . Max 5000.
  7. -f json
    for programmatic processing / feeding other skills;
    -f md
    or
    -f table
    for human-readable output.
  8. 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.
  1. 币种符号为纯永续合约名称——
    BTC
    ETH
    SOL
    HYPE
    (无需交易所前缀)。现货交易对格式为
    BASE/USDC
    (例如
    PURR/USDC
    );对于
    book
    /
    candles
    命令,可传入永续合约币种或现货交易对。
  2. markets
    是查询「某币种/整体市场表现」的默认入口
    ——每条记录包含标记价格/预言机价格/中间价、24小时涨跌幅、小时资金费率+年化费率、持仓量(币种数量和名义价值)、24小时交易量。可通过
    --coin
    筛选单个资产。
  3. 资金费率有两种展示方式——
    fundingHrPct
    为原始小时费率(百分比);
    fundingAprPct
    为年化费率(
    小时费率 × 24 × 365
    )。跨资产对比持仓成本时优先使用年化费率;查询「下一小时需支付/收取的费用」时使用小时费率。
  4. funding-compare
    是资金费率套利筛选工具
    ——它会根据各平台的间隔(HL为小时级,Binance/Bybit通常为4小时级)计算年化费率,并展示
    hlVsBinancePct
    /
    hlVsBybitPct
    差值。默认按HL与Binance的绝对差值排序(差值最大的排在最前)。
    hlVsBinancePct
    为正值意味着HL多头支付的费率高于Binance多头。
  5. book
    默认展示每侧10档深度
    ——可提高
    --depth
    参数(最大20)查看更多档位,或使用
    --n-sig-figs 2..5
    合并价格档位。可根据最优买价和最优卖价计算点差/中间价。
  6. candles
    获取最近
    --limit
    --interval
    周期的蜡烛图
    (默认
    1h
    周期,100根蜡烛)。支持的周期:
    1m 3m 5m 15m 30m 1h 2h 4h 8h 12h 1d 3d 1w 1M
    。最大支持5000根。
  7. -f json
    适用于程序化处理/为其他工具提供数据;
    -f md
    -f table
    适用于人类可读输出。
  8. 切勿调用任何写入操作。本工具仅提供只读市场数据——不读取账户信息,不下单、修改订单、取消订单,也不进行转账。插件故意不暴露任何写入端点。

Output format flag (
-f
)

输出格式参数(
-f
)

FormatFlagBest for
Table
-f table
(default)
Human-readable terminal output
JSON
-f json
Programmatic processing, LLM context
YAML
-f yaml
Structured, readable
Markdown
-f md
Reports
CSV
-f csv
Spreadsheet export
格式参数最佳适用场景
表格
-f table
(默认)
终端可读输出
JSON
-f json
程序化处理、LLM上下文
YAML
-f yaml
结构化可读输出
Markdown
-f md
报告文档
CSV
-f csv
导出至电子表格

Output columns

输出列

  • markets
    coin
    ,
    markPx
    ,
    midPx
    ,
    oraclePx
    ,
    change24hPct
    ,
    fundingHrPct
    ,
    fundingAprPct
    ,
    openInterest
    ,
    oiNotional
    ,
    dayNtlVlm
    ,
    premiumPct
    ,
    maxLeverage
  • spot-markets
    pair
    ,
    base
    ,
    markPx
    ,
    midPx
    ,
    change24hPct
    ,
    dayNtlVlm
    ,
    circulatingSupply
    ,
    marketCap
    ,
    canonical
  • mids
    coin
    ,
    mid
  • book
    side
    ,
    level
    ,
    px
    ,
    sz
    ,
    orders
  • candles
    time
    ,
    open
    ,
    high
    ,
    low
    ,
    close
    ,
    volume
    ,
    trades
  • funding-history
    coin
    ,
    fundingRatePct
    ,
    fundingAprPct
    ,
    premiumPct
    ,
    time
  • funding-compare
    coin
    ,
    hlAprPct
    ,
    binanceAprPct
    ,
    bybitAprPct
    ,
    hlVsBinancePct
    ,
    hlVsBybitPct
    ,
    nextHlFunding

  • markets
    coin
    markPx
    midPx
    oraclePx
    change24hPct
    fundingHrPct
    fundingAprPct
    openInterest
    oiNotional
    dayNtlVlm
    premiumPct
    maxLeverage
  • spot-markets
    pair
    base
    markPx
    midPx
    change24hPct
    dayNtlVlm
    circulatingSupply
    marketCap
    canonical
  • mids
    coin
    mid
  • book
    side
    level
    px
    sz
    orders
  • candles
    time
    open
    high
    low
    close
    volume
    trades
  • funding-history
    coin
    fundingRatePct
    fundingAprPct
    premiumPct
    time
  • funding-compare
    coin
    hlAprPct
    binanceAprPct
    bybitAprPct
    hlVsBinancePct
    hlVsBybitPct
    nextHlFunding

Step 4: Present the Results

步骤4:展示结果

  1. Lead with the headline number, then the table. For
    markets --coin BTC
    : state mark price, 24h change, funding APR, and open interest in prose first. For a full
    markets
    dump: lead with the count and the top movers / highest-funding names.
  2. 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.
  3. For
    funding-compare
    , 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.
  4. For
    book
    , 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.
  5. For
    candles
    , describe the move
    — first/last close, high/low, and direction; only show the full OHLCV table when the user wants the series.
  6. Filter aggressively before showing
    markets
    has ~180 perps and
    mids
    ~700 markets; cap to top 15-20 by the relevant sort unless the user asks for the full list.
  7. Cross-reference for trade decisions — Hyperliquid is the on-chain venue; for equities/options context pair it with the
    funda-data
    or
    tradingview-reader
    skills. For funding/basis trades,
    funding-compare
    plus
    markets
    (premium, OI) is the core view.

  1. 先展示核心数据,再展示表格。例如查询
    markets --coin BTC
    时:先以文字形式说明标记价格、24小时涨跌幅、资金年化费率和持仓量。若查询完整
    markets
    列表:先说明总数,再展示涨幅最大/资金费率最高的币种。
  2. 从持仓成本角度描述资金费率——例如「BTC永续合约资金费率为+10.9%年化(多头支付给空头)」。正资金费率⇒多头支付给空头;负资金费率⇒空头支付给多头。
  3. 对于
    funding-compare
    ,优先展示差值最大的币种
    ——说明币种名称、两个平台的年化费率及差值,注意差值是年化的;实际套利还需考虑交易所/提现成本,因此仅作为筛选工具,而非绝对套利机会。
  4. 对于
    book
    ,先报告点差
    ——最优买价、最优卖价、中间价及点差(基点),除非用户要求,否则无需展示所有档位。
  5. 对于
    candles
    ,描述价格走势
    ——开盘价/收盘价、最高价/最低价及趋势;仅当用户需要完整序列时才展示OHLCV表格。
  6. 展示前严格筛选——
    markets
    包含约180个永续合约,
    mids
    包含约700个市场;除非用户要求完整列表,否则按相关排序保留前15-20条。
  7. 为交易决策提供交叉参考——Hyperliquid是链上平台;若需股票/期权相关信息,可搭配
    funda-data
    tradingview-reader
    工具。对于资金费率/基差交易,
    funding-compare
    搭配
    markets
    (溢价、持仓量)是核心视图。

Step 5: Diagnostics

步骤5:诊断测试

bash
opencli hyperliquid markets --coin BTC
A successful BTC row confirms opencli, the plugin, and the public API are all reachable. If it errors with
Unknown command: hyperliquid
, reinstall the plugin (Step 1). A
hyperliquid info 4xx/5xx
is an upstream API issue — retry after a short wait.

bash
opencli hyperliquid markets --coin BTC
成功返回BTC数据行说明opencli、插件及公共API均可正常访问。若报错
Unknown command: hyperliquid
,请重新安装插件(步骤1)。若出现
hyperliquid info 4xx/5xx
错误,属于上游API问题——等待片刻后重试。

Error Reference

错误参考

ErrorCauseFix
Unknown command: hyperliquid
Plugin not installed
opencli plugin install github:himself65/finance-skills/hyperliquid
hyperliquid info 429
Rate limitedWait a few seconds, then retry
hyperliquid info 422/500
Malformed body or upstream issueRe-check the coin/interval; retry after a wait
No perp market for coin "X"
Wrong/unlisted symbolRun
opencli hyperliquid markets
(or
mids
) to find the exact symbol

错误原因解决方法
Unknown command: hyperliquid
未安装插件执行
opencli plugin install github:himself65/finance-skills/hyperliquid
hyperliquid info 429
触发速率限制等待几秒后重试
hyperliquid info 422/500
请求体格式错误或上游问题检查币种/周期参数;等待片刻后重试
No perp market for coin "X"
符号错误/未上市执行
opencli hyperliquid markets
(或
mids
)查询准确符号

Reference Files

参考文件

  • references/commands.md
    — Every command with all flags, output schemas, and analyst workflows (funding carry, basis/arb, spot snapshot)
  • references/commands.md
    — 包含所有命令、参数、输出 schema 及分析师工作流(资金持仓成本、基差/套利、现货快照)