Hyperliquid trading plugin with background position monitoring and custom automations. Execute market orders, limit orders, manage positions, view funding rates, run trading strategies, and write event-driven automation scripts with automatic alerts for PnL changes and liquidation risk.
Execute trading operations on Hyperliquid DEX with builder fee support.
npm install -g openbroker
# 1. Setup (generates wallet, creates config, approves builder fee)
openbroker setup
# 2. Fund your wallet with USDC on Arbitrum, then deposit at https://app.hyperliquid.xyz/
# 3. Start trading
openbroker account
openbroker buy --coin ETH --size 0.1
Always search before trading an unfamiliar asset. Hyperliquid has main perps (ETH, BTC, SOL...), HIP-3 perps (xyz:CL, xyz:GOLD, km:USOIL...), and spot markets. Use search to discover the correct ticker:
openbroker search --query GOLD # Find all GOLD markets across all providers
openbroker search --query oil # Find oil-related assets (CL, BRENTOIL, USOIL...)
openbroker search --query BTC --type perp # BTC perps only
openbroker search --query NATGAS --type hip3 # HIP-3 only
Or with the ob_search plugin tool: { "query": "gold" } or { "query": "oil", "type": "hip3" }
HIP-3 assets use dex:COIN format — e.g., xyz:CL not just CL. If you get an error like "No market data found", search for the asset to find the correct prefixed ticker. Common HIP-3 dexes: xyz, flx, km, hyna, vntl, cash.
If an ob_* plugin tool returns unexpected errors, empty results, or crashes, fall back to the equivalent CLI command via Bash. The CLI and plugin tools share the same core code, but the CLI has more mature error handling and output.
| Plugin Tool | CLI Equivalent |
|---|---|
ob_account | openbroker account --json |
ob_positions | openbroker positions --json |
ob_funding | openbroker funding --json --include-hip3 |
ob_markets | openbroker markets --json --include-hip3 |
ob_search | openbroker search --query <QUERY> |
ob_buy | openbroker buy --coin <COIN> --size <SIZE> |
ob_sell | openbroker sell --coin <COIN> --size <SIZE> |
ob_limit | openbroker limit --coin <COIN> --side <SIDE> --size <SIZE> --price <PRICE> |
ob_tpsl | openbroker tpsl --coin <COIN> --tp <PRICE> --sl <PRICE> |
ob_cancel | openbroker cancel --all or --coin <COIN> |
ob_fills | openbroker fills --json |
ob_orders | openbroker orders --json |
ob_funding_scan | openbroker funding-scan --json |
ob_candles | openbroker candles --coin <COIN> --json |
ob_auto_run | openbroker auto run <script> [--dry] |
ob_auto_stop | (stop via SIGINT when using CLI) |
ob_auto_list | openbroker auto list |
When to use CLI fallback:
null, empty data, or throws an error--verbose debug output)Add --dry to any trading CLI command to preview without executing. Add --json to info commands for structured output.
openbroker setup # One-command setup (wallet + config + builder approval)
openbroker approve-builder --check # Check builder fee status (for troubleshooting)
The setup command offers three modes:
For options 1 and 2, setup saves config and approves the builder fee automatically. For option 3 (API wallet), see the API Wallet Setup section below.
The simplest setup for agents. A fresh wallet is generated, the builder fee is auto-approved, and the agent is ready to trade immediately after funding.
Flow:
openbroker setup and choose option 1 ("Generate a fresh wallet")API wallets can place trades on behalf of a master account but cannot withdraw funds. Use this if you prefer to keep funds in your existing wallet and only delegate trading access.
Flow:
openbroker setup and choose option 3 ("Generate API wallet")https://openbroker.dev/approve?agent=0xABC...)ApproveAgent (authorizes the API wallet) and ApproveBuilderFee (approves the 1 bps fee)After setup, the config will contain:
HYPERLIQUID_PRIVATE_KEY=0x... # API wallet private key
HYPERLIQUID_ACCOUNT_ADDRESS=0x... # Master account address
HYPERLIQUID_NETWORK=mainnet
Important for agents: When using an API wallet, pass the approval URL to the agent owner (the human who controls the master wallet). The owner must approve in a browser before the agent can trade. The CLI waits up to 10 minutes for the approval. If it times out, re-run openbroker setup.
openbroker account # Balance, equity, margin
openbroker account --orders # Include open orders
openbroker account --address 0xabc... # Look up another account
openbroker positions # Open positions with PnL
openbroker positions --coin ETH # Specific coin
openbroker positions --address 0xabc... # Another account's positions
openbroker funding --top 20 # Top 20 by funding rate
openbroker funding --coin ETH # Specific coin
openbroker markets --top 30 # Top 30 main perps
openbroker markets --coin BTC # Specific coin
openbroker all-markets # Show all markets
openbroker all-markets --type perp # Main perps only
openbroker all-markets --type hip3 # HIP-3 perps only
openbroker all-markets --type spot # Spot markets only
openbroker all-markets --top 20 # Top 20 by volume
openbroker search --query GOLD # Find all GOLD markets
openbroker search --query BTC # Find BTC across all providers
openbroker search --query ETH --type perp # ETH perps only
openbroker spot # Show all spot markets
openbroker spot --coin PURR # Show PURR market info
openbroker spot --balances # Show your spot balances
openbroker spot --balances --address 0xabc... # Another account's spot balances
openbroker spot --top 20 # Top 20 by volume
openbroker fills # Recent fills
openbroker fills --coin ETH # ETH fills only
openbroker fills --coin BTC --side buy --top 50
openbroker fills --address 0xabc... # Another account's fills
openbroker orders # Recent orders (all statuses)
openbroker orders --open # Currently open orders only
openbroker orders --open --coin ETH # Open orders for a specific coin
openbroker orders --coin ETH --status filled
openbroker orders --top 50
openbroker orders --address 0xabc... --open # Another account's open orders
openbroker order-status --oid 123456789 # Check specific order
openbroker order-status --oid 0x1234... # By client order ID
openbroker order-status --oid 123456789 --address 0xabc... # On another account
openbroker fees # Fee tier, rates, and volume
openbroker fees --address 0xabc... # Another account's fees
openbroker candles --coin ETH # 24 hourly candles
openbroker candles --coin BTC --interval 4h --bars 48 # 48 four-hour bars
openbroker candles --coin SOL --interval 1d --bars 30 # 30 daily bars
openbroker funding-history --coin ETH # Last 24h
openbroker funding-history --coin BTC --hours 168 # Last 7 days
openbroker trades --coin ETH # Last 30 trades
openbroker trades --coin BTC --top 50 # Last 50 trades
openbroker rate-limit # API usage and capacity
openbroker funding-scan # Scan all dexes, >25% threshold
openbroker funding-scan --threshold 50 --pairs # Show opposing funding pairs
openbroker funding-scan --hip3-only --top 20 # HIP-3 only
openbroker funding-scan --watch --interval 120 # Re-scan every 2 minutes
All trading commands support HIP-3 assets using dex:COIN syntax:
openbroker buy --coin xyz:CL --size 1 # Buy crude oil on xyz dex
openbroker sell --coin xyz:BRENTOIL --size 1 # Sell brent oil
openbroker limit --coin xyz:GOLD --side buy --size 0.1 --price 2500
openbroker buy --coin ETH --size 0.1
openbroker sell --coin BTC --size 0.01
openbroker buy --coin SOL --size 5 --slippage 100 # Custom slippage (bps)
openbroker market --coin ETH --side buy --size 0.1
openbroker market --coin BTC --side sell --size 0.01 --slippage 100
openbroker limit --coin ETH --side buy --size 1 --price 3000
openbroker limit --coin SOL --side sell --size 10 --price 200 --tif ALO
# Set take profit at $40, stop loss at $30
openbroker tpsl --coin HYPE --tp 40 --sl 30
# Set TP at +10% from entry, SL at entry (breakeven)
openbroker tpsl --coin HYPE --tp +10% --sl entry
# Set only stop loss at -5% from entry
openbroker tpsl --coin ETH --sl -5%
# Partial position TP/SL
openbroker tpsl --coin ETH --tp 4000 --sl 3500 --size 0.5
# Take profit: sell when price rises to $40
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 40 --type tp
# Stop loss: sell when price drops to $30
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 30 --type sl
openbroker cancel --all # Cancel all orders
openbroker cancel --coin ETH # Cancel ETH orders only
openbroker cancel --oid 123456 # Cancel specific order
# Buy 1 ETH over 30 minutes (exchange handles slicing)
openbroker twap --coin ETH --side buy --size 1 --duration 30
# Sell 0.5 BTC over 2 hours without randomized timing
openbroker twap --coin BTC --side sell --size 0.5 --duration 120 --randomize false
# Cancel a running TWAP
openbroker twap-cancel --coin ETH --twap-id 77738308
# Check TWAP status
openbroker twap-status --active
# Place 5 buy orders ranging 2% below current price
openbroker scale --coin ETH --side buy --size 1 --levels 5 --range 2
# Scale out with exponential distribution
openbroker scale --coin BTC --side sell --size 0.5 --levels 4 --range 3 --distribution exponential --reduce
# Long ETH with 3% take profit and 1.5% stop loss
openbroker bracket --coin ETH --side buy --size 0.5 --tp 3 --sl 1.5
# Short with limit entry
openbroker bracket --coin BTC --side sell --size 0.1 --entry limit --price 100000 --tp 5 --sl 2
# Chase buy with ALO orders until filled
openbroker chase --coin ETH --side buy --size 0.5 --timeout 300
# Aggressive chase with tight offset
openbroker chase --coin SOL --side buy --size 10 --offset 2 --timeout 60
Limit Orders (openbroker limit):
Trigger Orders (openbroker trigger, openbroker tpsl):
| Scenario | Command |
|---|---|
| Buy at specific price below market | openbroker limit |
| Sell at specific price above market | openbroker limit |
| Stop loss (exit if price drops) | openbroker trigger --type sl |
| Take profit (exit at target) | openbroker trigger --type tp |
| Add TP/SL to existing position | openbroker tpsl |
All commands support --dry for dry run (preview without executing).
| Argument | Description |
|---|---|
--coin | Asset symbol (ETH, BTC, SOL, HYPE, etc.) |
--side | Order direction: buy or sell |
--size | Order size in base asset |
--price | Limit price |
--dry | Preview without executing |
--help | Show command help |
| Argument | Description |
|---|---|
--trigger | Trigger price (for trigger orders) |
--type | Trigger type: tp or sl |
--slippage | Slippage tolerance in bps (for market orders) |
--tif | Time in force: GTC, IOC, ALO |
--reduce | Reduce-only order |
| Format | Example | Description |
|---|---|---|
| Absolute | --tp 40 | Price of $40 |
| Percentage up | --tp +10% | 10% above entry |
| Percentage down | --sl -5% | 5% below entry |
| Entry price | --sl entry | Breakeven stop |
Config is loaded from (in priority order):
.env in current directory~/.openbroker/.env (global config)Run openbroker setup to create the global config interactively.
| Variable | Required | Description |
|---|---|---|
HYPERLIQUID_PRIVATE_KEY | Yes | Wallet private key (0x...) |
HYPERLIQUID_NETWORK | No | mainnet (default) or testnet |
HYPERLIQUID_ACCOUNT_ADDRESS | No | Master account address (required for API wallets) |
OB_DASHBOARD_URL | No | Dashboard API URL for forwarding audit notes, metrics, and agent actions (e.g. http://localhost:3001) |
The builder fee (1 bps / 0.01%) is hardcoded and not configurable.
This skill works standalone via Bash — every command above runs through the openbroker CLI. For enhanced features, the same openbroker npm package also ships as an OpenClaw plugin that you can enable alongside this skill.
ob_account, ob_buy, ob_limit, etc.) — typed tool calls with proper input schemas instead of Bash strings. The agent gets structured JSON responses.ob_auto_run, ob_auto_stop, ob_auto_list) — start, stop, and manage custom trading automations from within the agent.openclaw ob status and openclaw ob watch for inspecting the watcher.The plugin is bundled in the same openbroker npm package. To enable it in your OpenClaw config: