@2oolkit/hyperliquid-cli
Trade perpetuals and spot on Hyperliquid — a high-performance onchain order book DEX — from your terminal or AI agent.
One package, three interfaces:
Power your agent
คำสั่งของผู้เผยแพร่เอง ไม่ใช่เอนด์พอยต์ของ PlugMCP
Host a copy with our keys and logs.
npx -y @2oolkit/[email protected]Claude Code ไม่มีลิงก์ติดตั้งสำหรับคำสั่งแบบโลคัล ให้คัดลอกคำสั่งด้านล่างแล้วรันในเทอร์มินัล
claude mcp add 2oolkit-hyperliquid-cli -- npx -y @2oolkit/hyperliquid-cli@0.2.7รันในเทอร์มินัล
{ "mcpServers": { "2oolkit-hyperliquid-cli": { "command": "npx", "args": [ "-y", "@2oolkit/[email protected]" ] } }}claude_desktop_config.json
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดจากผู้เผยแพร่
Trade perpetuals and spot on Hyperliquid — a high-performance onchain order book DEX — from your terminal or AI agent.
One package, three interfaces:
CLI & MCP server for Hyperliquid DEX — trade perpetuals & spot, manage orders, and query market data
| Interface | Command | Use Case |
|---|
| CLI | hyperliquid-cli | Terminal trading, scripting, automation |
| MCP Server | hyperliquid-mcp | AI agents (Claude, Cursor, Windsurf, etc.) |
| OpenClaw Skill | skill/SKILL.md | AI agent ecosystem (OpenClaw, ClawdBot) |
200+ perpetual instruments, spot tokens, TWAP orders, and full account management.
npm install -g @2oolkit/hyperliquid-cli
This installs both hyperliquid-cli (CLI) and hyperliquid-mcp (MCP server).
# 1. Interactive setup (prompts for environment, private key)
hyperliquid-cli config init
# 2. Check a price (no auth needed)
hyperliquid-cli market ticker BTC
# 3. Place a limit buy
hyperliquid-cli order place -c BTC -s buy -p 60000 -z 0.001
# 4. View open orders
hyperliquid-cli order list
Interactive setup (recommended):
hyperliquid-cli config init
Prompts for:
The wallet address is automatically derived from the private key.
Manual setup:
hyperliquid-cli config set --env mainnet --private-key <hex-key>
Environment variables (CI/CD, Docker):
export HYPERLIQUID_WALLET_PRIVATE_KEY=<your-private-key>
export HYPERLIQUID_WALLET_ADDRESS=<your-wallet-address>
View current config:
hyperliquid-cli config list
hyperliquid-cli config get env
Config is saved to ~/.hyperliquid-cli/config.json with 0600 permissions.
hyperliquid-cli market meta # List all perpetual instruments
hyperliquid-cli market meta --spot # List spot instruments
hyperliquid-cli market all-mids # All mid prices
hyperliquid-cli market ticker BTC # Price, volume, funding, OI
hyperliquid-cli market ticker BTC --spot # Spot ticker
hyperliquid-cli market orderbook BTC # L2 order book
hyperliquid-cli market orderbook BTC -d 3 # 3 sig figs depth
hyperliquid-cli market candles BTC -i 1h -n 500 # OHLCV candles (default 500)
hyperliquid-cli market candles BTC -i 1h -n 5000 # Up to 5000 in one request
hyperliquid-cli market candles BTC -i 1h -n 10000 --paginate # Auto-paginate for more
hyperliquid-cli market funding BTC --hours 24 # Funding rate history
hyperliquid-cli market funding BTC --predicted # Predicted funding rates
hyperliquid-cli market trades BTC # Recent trades
Candles (OHLCV):
The candleSnapshot endpoint returns up to 5000 candles per request (rolling
time window, no cursor). The CLI defaults to -n 500.
hyperliquid-cli market candles BTC -i 1h -n 5000 -o json # Max in a single request
hyperliquid-cli market candles BTC -i 1h -n 10000 --paginate -o json # Fetch more via auto-pagination
hyperliquid-cli market candles BTC -i 15m --start-time 1700000000000 --end-time 1700864000000 --paginate -o json
-n exceeds 5000 without --paginate, the count is clamped to 5000 with a warning.--paginate, requests are repeated with endTime = (oldest candle).t − 1ms until the requested count is reached or history is exhausted; results are deduped and sorted ascending by time.# Place orders
hyperliquid-cli order place -c BTC -s buy -p 60000 -z 0.001 # Limit buy (Gtc)
hyperliquid-cli order place -c BTC -s sell -p 80000 -z 0.001 # Limit sell
hyperliquid-cli order place -c BTC -s buy -p 70000 -z 0.001 --tif Ioc # Immediate-or-cancel
hyperliquid-cli order place -c BTC -s buy -p 70000 -z 0.001 --tif Alo # Post-only (add liquidity)
hyperliquid-cli order place -c BTC -s sell -z 0.001 --trigger-px 65000 --tpsl sl # Stop-loss
hyperliquid-cli order place -c BTC -s sell -z 0.001 --reduce-only -p 80000 # Reduce-only
# Manage orders
hyperliquid-cli order list # Open orders
hyperliquid-cli order get <oid> # Order status by ID
hyperliquid-cli order cancel -c BTC --oid <oid> # Cancel one
hyperliquid-cli order cancel-all # Cancel all open orders
hyperliquid-cli order cancel-all -c BTC # Cancel all BTC orders only
hyperliquid-cli order modify --oid <oid> -c BTC -s buy -p 61000 -z 0.002 # Modify order
# History
hyperliquid-cli order history # Order history
hyperliquid-cli order fills # Recent fills
hyperliquid-cli order fills --hours 48 # Fills from last 48h
# TWAP
hyperliquid-cli order twap -c BTC -s buy -z 0.1 -m 30 # TWAP over 30 minutes
hyperliquid-cli order twap-cancel -c BTC --twap-id <id> # Cancel TWAP
# Dead man switch
hyperliquid-cli order schedule-cancel --delay 60 # Cancel all orders in 60s
Order place options:
hyperliquid-cli position list # All open positions + margin
hyperliquid-cli position leverage -c BTC -l 10 # Set 10x cross leverage
hyperliquid-cli position leverage -c BTC -l 5 --isolated # Set 5x isolated
hyperliquid-cli position margin -c BTC -s buy -a 100 # Add $100 isolated margin
hyperliquid-cli account state # Clearinghouse state (positions + margin)
hyperliquid-cli account spot # Spot token balances
hyperliquid-cli account portfolio # Portfolio summary
hyperliquid-cli account fees # Fee schedule
hyperliquid-cli account rate-limit # Rate limit status
hyperliquid-cli account sub-accounts # Sub-accounts
hyperliquid-cli account referral # Referral info
hyperliquid-cli account role # User role
hyperliquid-cli transfer usd-send -d <address> -a 100 # Send USDC on Hyperliquid
hyperliquid-cli transfer spot-send -d <address> -t <token> -a 10 # Send spot token
hyperliquid-cli transfer withdraw -d <address> -a 100 # Withdraw to Arbitrum (~5 min, $1 fee)
hyperliquid-cli transfer spot-to-perp -a 100 # Spot → Perp
hyperliquid-cli transfer perp-to-spot -a 100 # Perp → Spot
hyperliquid-cli transfer vault-deposit -v <vault> -a 100 # Vault deposit
hyperliquid-cli transfer vault-withdraw -v <vault> -a 100 # Vault withdraw
hyperliquid-cli transfer approve-agent -a <address> # Approve API agent
All commands support -o json for scripting and piping:
hyperliquid-cli market ticker BTC -o json
hyperliquid-cli order list -o json | jq '.[].oid'
The MCP (Model Context Protocol) server exposes all Hyperliquid functionality as tools for AI agents. Works with Claude Code, Claude Desktop, Cursor, Windsurf, and any MCP-compatible client.
claude mcp add hyperliquid-mcp -- hyperliquid-mcp
Add to your MCP config file:
{
"mcpServers": {
"hyperliquid": {
"command": "hyperliquid-mcp"
}
}
}
Or without global install:
{
"mcpServers": {
"hyperliquid": {
"command": "npx",
"args": ["-y", "-p", "@2oolkit/hyperliquid-cli", "hyperliquid-mcp"]
}
}
}
Option 1: CLI setup (recommended)
hyperliquid-cli config init
The MCP server reads the same config as the CLI (~/.hyperliquid-cli/).
Option 2: Environment variables in MCP config
Pass credentials directly in your MCP config file — no CLI setup needed:
{
"mcpServers": {
"hyperliquid": {
"command": "hyperliquid-mcp",
"env": {
"HYPERLIQUID_WALLET_PRIVATE_KEY": "0x..."
}
}
}
}
This package includes an OpenClaw skill definition for AI agent ecosystems. The skill file is located at skill/SKILL.md with detailed reference docs in skill/references/.
Compatible with OpenClaw, ClawdBot, and other agent skill platforms.
Hyperliquid uses short coin names (not trading pairs):
Use hyperliquid-cli market meta -o json for the full list with size decimals and max leverage.
Spot tokens use the same names. Add --spot flag for spot-specific commands.
# Long position → sell reduce-only at market
hyperliquid-cli order place -c BTC -s sell -z 0.001 -p 100000 --tif Ioc --reduce-only
# Short position → buy reduce-only at market
hyperliquid-cli order place -c ETH -s buy -z 0.01 -p 1 --tif Ioc --reduce-only
hyperliquid-cli order place -c BTC -s buy -z 0.01 -p 68000
hyperliquid-cli order place -c BTC -s sell -z 0.01 -p 75000 --reduce-only
hyperliquid-cli order cancel-all
hyperliquid-cli position list -o json
# For each position, create opposite reduce-only order
hyperliquid-cli account state -o json
hyperliquid-cli position list -o json
hyperliquid-cli order list -o json
Errors include actionable recovery instructions:
Error: Private key is not configured.
Try: hyperliquid-cli config init
--reduce-only for exit orders — prevents accidental position flipshyperliquid-cli market meta -o json for size decimals and max leverage0600 permissions, key is masked in outputhyperliquid-cli config set --env testnetConfig uses 0600 permissions (owner read/write only). Private key is masked when displayed.
MIT
CLI & MCP server for Hyperliquid DEX — trade perpetuals & spot, manage orders, and query market data
{ "mcpServers": { "2oolkit-hyperliquid-cli": { "command": "npx", "args": [ "-y", "@2oolkit/[email protected]" ] } }}เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
@2oolkit/hyperliquid Cli ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-10 CLI & MCP server for Hyperliquid DEX — trade perpetuals & spot, manage orders, and query market data