当前位置: 首页 > Skill >

HyperClaw

HyperClaw

0.1.15 2026.11.26 浏览:916
获取Skill文件查看使用说明
作者:许禾许可证:
本文目录展开

HyperClaw - Hyperliquid Trading Skill

Trade on Hyperliquid via CLI. Covers native crypto perps (BTC, ETH, SOL, etc.), HIP-3 builder-deployed perps (equities, commodities, forex), market scanning, and intelligence tools.

Setup

Run the setup script once to create a virtual environment and install dependencies:

bash {baseDir}/scripts/setup.sh

Then configure .env in the skill root directory with your Hyperliquid API credentials:

HL_ACCOUNT_ADDRESS=0x_your_wallet_address
HL_SECRET_KEY=0x_your_api_wallet_private_key
HL_TESTNET=false

Get API keys from: https://app.hyperliquid.xyz/API — use a separate API wallet, not your main wallet private key.

Optional for intelligence commands (sentiment, unlocks, devcheck, ask, search):

XAI_API_KEY=xai-...

After configuring .env, start the caching proxy (prevents rate limiting):

{baseDir}/scripts/.venv/bin/python {baseDir}/scripts/server.py &

How to Run Commands

{baseDir}/scripts/.venv/bin/python {baseDir}/scripts/hyperliquid_tools.py <command> [args]

Command Reference

Account

Command Description Example
status Account balance, account mode, positions, PnL (handles unified/portfolio margin accounts) hyperliquid_tools.py status
positions Detailed position info (leverage, liquidation) hyperliquid_tools.py positions
orders Open orders hyperliquid_tools.py orders
check Position health check (book ratio, funding, PnL, leverage, liquidation warnings) hyperliquid_tools.py check or check --address 0x...
user-funding Your funding payments received/paid hyperliquid_tools.py user-funding --lookback 7d
portfolio Portfolio performance (PnL, volume by period) hyperliquid_tools.py portfolio or portfolio --address 0x...
swap Swap USDC ↔ HIP-3 dex collateral (USDH, USDe, USDT0, USDXL) hyperliquid_tools.py swap 20 or swap 20 --token USDe or swap 10 --to-usdc

Market Data

Command Description Example
price [COINS...] Current prices (supports HIP-3 dex prefix) hyperliquid_tools.py price BTC ETH xyz:TSLA
funding [COINS...] Funding rates (hourly + APR + signal). --predicted shows the estimated rate for the next hourly settlement (can still shift as mark/oracle prices move before the hour closes), with Binance/Bybit comparison (APR-normalized across different intervals). Use predicted to preview upcoming charges and confirm a funding edge isn't HL-specific. hyperliquid_tools.py funding BTC SOL DOGE or funding BTC --predicted
book COIN L2 order book with spread hyperliquid_tools.py book SOL
candles COIN OHLCV candlestick data with SMA hyperliquid_tools.py candles BTC --interval 1h --lookback 7d
funding-history COIN Historical funding rates with summary hyperliquid_tools.py funding-history BTC --lookback 24h
trades COIN Recent trade tape with buy/sell bias hyperliquid_tools.py trades BTC --limit 20
raw COIN Raw JSON data dump for processing hyperliquid_tools.py raw BTC

Analysis

Command Description Example
analyze [COINS...] Comprehensive market analysis (prices, funding, OI, volume, book depth) hyperliquid_tools.py analyze BTC ETH SOL
scan Scan all perps for funding opportunities. --sort {funding|volume|oi|price-change} outputs a single flat table sorted by the chosen metric (default: multi-section view). --reverse reverses sort direction. hyperliquid_tools.py scan --top 20 --min-volume 100000 or scan --sort volume --top 10 --reverse
hip3 [COIN] HIP-3 perp data (price, spread, funding) hyperliquid_tools.py hip3 TSLA
hip3 All HIP-3 dex assets hyperliquid_tools.py hip3
dexes List all HIP-3 dexes and their assets hyperliquid_tools.py dexes
history Trade history from API hyperliquid_tools.py history --limit 20

Trading

Command Description Example
leverage COIN LEV Set leverage for an asset (persists on Hyperliquid) hyperliquid_tools.py leverage SOL 5
leverage COIN LEV --isolated Set leverage with isolated margin hyperliquid_tools.py leverage xyz:TSLA 3 --isolated
buy COIN SIZE Market buy (long) hyperliquid_tools.py buy SOL 0.5
buy COIN SIZE --leverage LEV Market buy with leverage set first hyperliquid_tools.py buy SOL 0.5 --leverage 5
sell COIN SIZE Market sell (short) hyperliquid_tools.py sell SOL 0.5
sell COIN SIZE --leverage LEV Market sell with leverage set first hyperliquid_tools.py sell SOL 0.5 --leverage 5
limit-buy COIN SIZE PRICE Limit buy order (GTC) hyperliquid_tools.py limit-buy SOL 1 120
limit-sell COIN SIZE PRICE Limit sell order (GTC) hyperliquid_tools.py limit-sell SOL 1 140
stop-loss COIN SIZE TRIGGER Stop-loss trigger (market, reduce-only) hyperliquid_tools.py stop-loss SOL 0.5 115
take-profit COIN SIZE TRIGGER Take-profit trigger (market, reduce-only) hyperliquid_tools.py take-profit SOL 0.5 150
close COIN Close entire position (supports HIP-3) hyperliquid_tools.py close SOL
cancel OID Cancel specific order hyperliquid_tools.py cancel 12345
cancel-all Cancel all open orders hyperliquid_tools.py cancel-all
modify-order OID PRICE Modify existing order price/size hyperliquid_tools.py modify-order 12345 130.5 --size 2

Leverage: Leverage is set per-asset on your Hyperliquid account and persists until changed. Each asset has a max leverage (e.g., BTC=40x, ETH=25x, SOL=20x). The leverage command and --leverage flag show the max and block if exceeded. Use positions to see current leverage on open positions. HIP-3 assets require isolated margin (--isolated).

Intelligence (requires XAI_API_KEY)

Command Description Example
sentiment COIN Grok web + X/Twitter sentiment analysis hyperliquid_tools.py sentiment BTC
unlocks [COINS...] Token unlock schedules (defaults to current positions) hyperliquid_tools.py unlocks SOL HYPE
devcheck COIN Developer sentiment and exodus signals hyperliquid_tools.py devcheck SOL
ask QUERY Ask Grok a question — single API call with web + X tools, returns one blended answer. --web for web only, --x for X only. hyperliquid_tools.py ask "what's driving ETH price today?" or ask "BTC whale activity" --x
search QUERY Search web and X/Twitter via Grok — separate API calls per source, prints results in distinct sections for more exhaustive coverage. --web for web only, --x for X only. hyperliquid_tools.py search "Hyperliquid token unlock schedule" or search "SOL news" --web

Prediction Markets

Command Description Example
polymarket [CATEGORY] Active Polymarket prediction markets hyperliquid_tools.py polymarket crypto

Categories: crypto (default), btc, eth, trending, macro

HIP-3 Trading

HIP-3 assets use a dex prefix: dex:SYMBOL

hyperliquid_tools.py buy xyz:TSLA 1          # Buy TSLA on xyz dex
hyperliquid_tools.py sell vntl:ANTHROPIC 1   # Sell ANTHROPIC on vntl dex
hyperliquid_tools.py close xyz:GOLD          # Close GOLD position
hyperliquid_tools.py funding xyz:TSLA vntl:SPACEX km:US500

Known HIP-3 dexes: xyz (equities, commodities), vntl (private companies), flx (crypto/commodities), hyna (crypto), km (indices), abcd, cash. Use dexes command to discover all available dexes dynamically.

HIP-3 differences from native perps:

  • Isolated margin only (no cross margin)
  • Per-position liquidation prices
  • Higher fees (2x normal)
  • Thinner order books (wider spreads)
  • Max leverage varies by asset (10x for most equities, 20x for commodities/metals)
  • Some dexes require non-USDC collateral — swap first (see below)

HIP-3 Collateral: Some dexes use stablecoin collateral other than USDC (e.g. USDH, USDe, USDT0). You must swap USDC to the required collateral before trading on these dexes. Use dexes to check current collateral requirements — they can change.

Collateral Swap command
USDC No swap needed
USDH swap <amount> (default)
USDe swap <amount> --token USDe
USDT0 swap <amount> --token USDT0
USDXL swap <amount> --token USDXL

Note on USDXL: USDXL (Last USD) is not on Hyperliquid's strict list and has lower liquidity than other collateral tokens. Expect wider spreads when swapping. No HIP-3 dex currently uses USDXL as collateral, but the swap is available if needed.

To swap collateral back to USDC: swap <amount> --to-usdc (or swap <amount> --token USDe --to-usdc).

Example workflow for km:US500:

hyperliquid_tools.py swap 20                          # Swap 20 USDC → USDH
hyperliquid_tools.py leverage km:US500 10 --isolated  # Set leverage
hyperliquid_tools.py buy km:US500 0.02                # Trade
hyperliquid_tools.py close km:US500                   # Close when done
hyperliquid_tools.py swap 20 --to-usdc                # Swap USDH back to USDC

Caching Proxy (Default — Start First)

Each CLI invocation cold-starts the SDK and burns ~40 API weight units just to initialize. With a 1200 weight/min IP limit, agents hit rate limits after ~30 commands. Always start the proxy before running commands.

Start the proxy:

{baseDir}/scripts/.venv/bin/python {baseDir}/scripts/server.py &

The .env file includes HL_PROXY_URL=http://localhost:18731 by default. All read commands will route through the proxy automatically. To disable the proxy (not recommended), comment out or remove HL_PROXY_URL from .env.

Restart the proxy after installing or updating the skill (e.g. git pull, dependency changes). The proxy runs in-memory — it won't pick up code or config changes until restarted:

# Find and kill existing proxy, then restart
kill $(lsof -ti:18731) 2>/dev/null; {baseDir}/scripts/.venv/bin/python {baseDir}/scripts/server.py &

Proxy endpoints:

Endpoint Description
GET /health Check proxy status and uptime
GET /cache/stats Cache hit/miss rates per type
POST /cache/clear Clear cache (optional body: {"type":"..."} or {"user":"0x..."})

The proxy caches /info read responses (metadata 300s, prices 5s, user state 2s). Trading commands (buy, sell, close, etc.) always go directly to the real Hyperliquid API — they bypass the proxy entirely because the SDK requires the real URL for transaction signing. The proxy is a read cache only. Responses include X-Cache: HIT or X-Cache: MISS headers.

Proxy env vars:

Variable Default Description
HL_UPSTREAM_URL https://api.hyperliquid.xyz Upstream API
HL_PROXY_PORT 18731 Proxy port
HL_CACHE_WARMUP true Pre-warm cache on startup

Environment Variables

Variable Required Description
HL_ACCOUNT_ADDRESS For trading/status Hyperliquid wallet address
HL_SECRET_KEY For trading API wallet private key
HL_TESTNET No false for mainnet (default), true for testnet
HL_PROXY_URL Recommended Caching proxy URL (default: http://localhost:18731)
HL_ENV_FILE No Override .env file path. When set, loads env vars from this file instead of default .env discovery. Useful for wrapper scripts that route to hyperclaw from other projects.
XAI_API_KEY For intelligence Grok API key for sentiment/unlocks/devcheck/ask/search

Read-only commands (price, funding, book, scan, hip3, dexes, raw, polymarket) work without credentials. Trading and account commands require HL_ACCOUNT_ADDRESS and HL_SECRET_KEY.

Account Abstraction Modes

Unified mode is recommended for API wallet trading. In standard mode, funds are split between spot and perp clearinghouses, and API wallets cannot transfer between them. Unified mode pools all funds into a single balance, so cross-margin perps can access your full balance without manual transfers. HIP-3 dexes that require non-USDC collateral work in both modes — just use the swap command to convert USDC to the required collateral.

Hyperliquid accounts operate in one of several modes that affect where balances live. The status command auto-detects the mode and shows it as a badge ([unified], [portfolio margin], or [standard]).

Mode Badge How balances work
Unified (default) [unified] Single balance per asset across all DEXes. Spot and perp share collateral. All balances appear in the spot clearinghouse.
Portfolio Margin [portfolio margin] All eligible assets (HYPE, BTC, USDH, USDC) unified into one margin calculation. Most capital-efficient. Pre-alpha.
Standard [standard] Separate balances for perps and spot on each DEX. No cross-collateralization.
DEX Abstraction [unified] Deprecated. USDC defaults to perps balance, other collateral to spot. Shown as [unified] since behavior is similar.

For position sizing, always use "Portfolio Value" from status. In standard mode this equals the perp account value. In unified/portfolio margin mode it equals perp accountValue + spot balances, since funds can live in either clearinghouse. The "Perp Margin" sub-line (only shown for non-standard modes) is just the perp clearinghouse portion — don't use it for sizing.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • HyperClaw - Hyperliquid Trading Skill
    • Setup
    • How to Run Commands
    • Command Reference
      • Account
      • Market Data
      • Analysis
      • Trading
      • Intelligence (requires XAI_API_KEY)
      • Prediction Markets
      • HIP-3 Trading
    • Caching Proxy (Default — Start First)
    • Environment Variables
    • Account Abstraction Modes
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期