| name | openbroker |
| description | Hyperliquid trading CLI. Execute market orders, limit orders, manage positions, view funding rates, and run trading strategies. Use for any Hyperliquid perp trading task. |
| license | MIT |
| compatibility | Requires Node.js 22+, network access to api.hyperliquid.xyz |
| metadata | {"author":"monemetrics","version":"1.0.37"} |
| allowed-tools | Bash(openbroker:*) Bash(npm:*) Read |
Open Broker - Hyperliquid Trading CLI
Execute trading operations on Hyperliquid DEX with builder fee support.
Installation
npm install -g openbroker
Quick Start
openbroker setup
openbroker account
openbroker buy --coin ETH --size 0.1
Command Reference
Setup
openbroker setup
openbroker approve-builder --check
The setup command handles everything:
- Generate new wallet or use existing private key
- Save config to
~/.openbroker/.env
- Automatically approve builder fee (required for trading)
Account Info
openbroker account
openbroker account --orders
openbroker positions
openbroker positions --coin ETH
Funding Rates
openbroker funding --top 20
openbroker funding --coin ETH
Markets
openbroker markets --top 30
openbroker markets --coin BTC
All Markets (Perps + Spot + HIP-3)
openbroker all-markets
openbroker all-markets --type perp
openbroker all-markets --type hip3
openbroker all-markets --type spot
openbroker all-markets --top 20
Search Markets (Find assets across providers)
openbroker search --query GOLD
openbroker search --query BTC
openbroker search --query ETH --type perp
Spot Markets
openbroker spot
openbroker spot --coin PURR
openbroker spot --balances
openbroker spot --top 20
Trading Commands
Market Orders (Quick)
openbroker buy --coin ETH --size 0.1
openbroker sell --coin BTC --size 0.01
openbroker buy --coin SOL --size 5 --slippage 100
Market Orders (Full)
openbroker market --coin ETH --side buy --size 0.1
openbroker market --coin BTC --side sell --size 0.01 --slippage 100
Limit Orders
openbroker limit --coin ETH --side buy --size 1 --price 3000
openbroker limit --coin SOL --side sell --size 10 --price 200 --tif ALO
Set TP/SL on Existing Position
openbroker tpsl --coin HYPE --tp 40 --sl 30
openbroker tpsl --coin HYPE --tp +10% --sl entry
openbroker tpsl --coin ETH --sl -5%
openbroker tpsl --coin ETH --tp 4000 --sl 3500 --size 0.5
Trigger Orders (Standalone TP/SL)
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 40 --type tp
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 30 --type sl
Cancel Orders
openbroker cancel --all
openbroker cancel --coin ETH
openbroker cancel --oid 123456
Advanced Execution
TWAP (Time-Weighted Average Price)
openbroker twap --coin ETH --side buy --size 1 --duration 3600
openbroker twap --coin BTC --side sell --size 0.5 --duration 1800 --intervals 6 --randomize 20
Scale In/Out (Grid Orders)
openbroker scale --coin ETH --side buy --size 1 --levels 5 --range 2
openbroker scale --coin BTC --side sell --size 0.5 --levels 4 --range 3 --distribution exponential --reduce
Bracket Order (Entry + TP + SL)
openbroker bracket --coin ETH --side buy --size 0.5 --tp 3 --sl 1.5
openbroker bracket --coin BTC --side sell --size 0.1 --entry limit --price 100000 --tp 5 --sl 2
Chase Order (Follow Price)
openbroker chase --coin ETH --side buy --size 0.5 --timeout 300
openbroker chase --coin SOL --side buy --size 10 --offset 2 --timeout 60
Trading Strategies
Funding Arbitrage
openbroker funding-arb --coin ETH --size 5000 --min-funding 25
openbroker funding-arb --coin BTC --size 10000 --duration 24 --check 30 --dry
Grid Trading
openbroker grid --coin ETH --lower 3000 --upper 4000 --grids 10 --size 0.1
openbroker grid --coin BTC --lower 90000 --upper 100000 --grids 5 --size 0.01 --mode long
DCA (Dollar Cost Averaging)
openbroker dca --coin ETH --amount 100 --interval 1h --count 24
openbroker dca --coin BTC --total 5000 --interval 1d --count 30
Market Making Spread
openbroker mm-spread --coin ETH --size 0.1 --spread 10
openbroker mm-spread --coin BTC --size 0.01 --spread 5 --max-position 0.1
Maker-Only MM (ALO orders)
openbroker mm-maker --coin HYPE --size 1 --offset 1
openbroker mm-maker --coin ETH --size 0.1 --offset 2 --max-position 0.5
Order Types
Limit Orders vs Trigger Orders
Limit Orders (openbroker limit):
- Execute immediately if price is met
- Rest on the order book until filled or cancelled
- A limit sell BELOW current price fills immediately (taker)
- NOT suitable for stop losses
Trigger Orders (openbroker trigger, openbroker tpsl):
- Stay dormant until trigger price is reached
- Only activate when price hits the trigger level
- Proper way to set stop losses and take profits
- Won't fill prematurely
When to Use Each
| 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 |
Common Arguments
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 |
Order Arguments
| 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 |
TP/SL Price Formats
| 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 |
Configuration
Config is loaded from (in priority order):
- Environment variables
.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 | For API wallets |
Risk Warning
- Always use
--dry first to preview orders
- Start with small sizes on testnet (
HYPERLIQUID_NETWORK=testnet)
- Monitor positions and liquidation prices
- Use
--reduce for closing positions only