Trading
Spot Trading
Buy and sell spot tokens on Hyperliquid. Spot orders use the same exchange endpoint as perps but with spot asset indices (10000 + spotIndex). No leverage or reduce-only — just buying and selling tokens.
openbroker spot-buy --coin PURR --size 1000 # Market buy 1000 PURR
openbroker spot-sell --coin HYPE --size 50 # Market sell 50 HYPE
openbroker spot-order --coin PURR --side buy --size 500 --price 0.005 # Limit buy
openbroker spot-order --coin HYPE --side sell --size 25 --tif Alo # Maker-only sell
openbroker spot-buy --coin PURR --size 1000 --dry # Preview without executing| Flag | Description | Default |
|---|---|---|
| --coin | Base token symbol (e.g., PURR, HYPE) | — |
| --side | Order side: buy or sell (auto-set by spot-buy/spot-sell) | — |
| --size | Size in base token units | — |
| --price | Limit price in quote token (omit for market order) | — |
| --tif | Time-in-force for limit orders: Gtc, Ioc, Alo | Gtc |
| --slippage | Slippage tolerance in bps for market orders | 50 |
| --dry | Preview without executing | — |
Check available spot markets and your balances with openbroker spot:
openbroker spot # Show all spot markets sorted by volume
openbroker spot --coin PURR # Show PURR market info
openbroker spot --balances # Show your spot token balances
openbroker spot --top 20 # Top 20 by volumeHIP-3 Perp Trading
All trading commands support HIP-3 builder-deployed markets using dex:COIN syntax. Use openbroker search to discover HIP-3 tickers.
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 tpsl --coin xyz:CL --tp +10% --sl -5% # Set TP/SL on HIP-3 position
openbroker funding-arb --coin xyz:CL --size 5000 # Funding arb on HIP-3 assetIf you use a bare coin name that exists on a HIP-3 dex (e.g., --coin CL), the CLI will suggest the correct prefixed ticker.
Market Orders
Execute market buy/sell with slippage protection. The buy and sell commands are shortcuts that set --side automatically.
openbroker buy --coin HYPE --size 0.1
openbroker sell --coin BTC --size 0.01
openbroker buy --coin SOL --size 10 --slippage 100 --dry
openbroker buy --coin HYPE --size 0.5 --leverage 10 # Set 10x leverage| Flag | Description | Default |
|---|---|---|
| --coin | Asset to trade (ETH, BTC, SOL, HYPE, etc.) | required |
| --side | Order direction: buy or sell (auto-set by buy/sell command) | required |
| --size | Order size in base asset | required |
| --slippage | Slippage tolerance in bps (basis points) | 50 (0.5%) |
| --leverage | Set leverage before placing the order (cross for main perps, isolated for HIP-3) | — |
| --reduce | Reduce-only order (won't increase position) | false |
| --dry | Preview order details without executing | — |
| --verbose | Show full API request/response | — |
Limit Orders
Place a limit order at a specific price. Supports three time-in-force modes.
openbroker limit --coin ETH --side buy --size 1 --price 3000
openbroker limit --coin BTC --side sell --size 0.1 --price 100000 --tif ALO
openbroker limit --coin SOL --side buy --size 10 --price 150 --reduce
openbroker limit --coin ETH --side buy --size 1 --price 3000 --leverage 5| Flag | Description | Default |
|---|---|---|
| --coin | Asset to trade | required |
| --side | Order direction: buy or sell | required |
| --size | Order size in base asset | required |
| --price | Limit price | required |
| --tif | Time in force: GTC (rests on book), IOC (fill or cancel), ALO (post-only, maker only) | GTC |
| --leverage | Set leverage before placing the order | — |
| --reduce | Reduce-only order | false |
| --dry | Preview without executing | — |
Trigger Orders
Place conditional orders that activate when price reaches a trigger level. Used for stop losses, take profits, and conditional entries.
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 40 --type tpopenbroker trigger --coin HYPE --side sell --size 0.5 --trigger 30 --type slopenbroker trigger --coin BTC --side buy --size 0.01 --trigger 75000 --type sl --reduce false| Flag | Description | Default |
|---|---|---|
| --coin | Asset to trade | required |
| --side | Order side when triggered: buy or sell | required |
| --size | Order size in base asset | required |
| --trigger | Trigger price (order activates at this level) | required |
| --type | Order type: tp (take profit) or sl (stop loss) | required |
| --limit | Custom limit price when triggered (overrides default) | auto |
| --slippage | Slippage for stop loss limit price in bps | 100 (1%) |
| --reduce | Reduce-only order | true |
| --dry | Preview without placing | — |
| --verbose | Show debug output | — |
TP/SL on Existing Position
Attach take-profit and/or stop-loss trigger orders to an open position. Supports absolute prices, percentage offsets from entry, and breakeven stops.
openbroker tpsl --coin HYPE --tp 40 --sl 30 # Absolute prices
openbroker tpsl --coin ETH --tp +10% --sl -5% # Percentage from entry
openbroker tpsl --coin HYPE --tp +10% --sl entry # TP at +10%, SL at entry (breakeven)
openbroker tpsl --coin ETH --sl -5% # Stop loss only
openbroker tpsl --coin ETH --tp 4000 --sl 3500 --size 0.5 # Partial position| Flag | Description | Default |
|---|---|---|
| --coin | Asset with an open position | required |
| --tp | Take profit price: absolute ($40), percentage (+10%), or "entry" | — |
| --sl | Stop loss price: absolute ($30), percentage (-5%), or "entry" | — |
| --size | Size to protect (partial TP/SL) | full position |
| --sl-slippage | Stop loss slippage buffer in bps | 100 (1%) |
| --dry | Preview orders without placing | — |
| --verbose | Show debug output | — |
Shows risk/reward ratio, potential profit/loss, and current unrealized PnL before placing orders.
Cancel Orders
openbroker cancel --all # Cancel all open orders
openbroker cancel --coin HYPE # Cancel all ETH orders
openbroker cancel --coin HYPE --oid 123456 # Cancel specific order
openbroker cancel --all --dry # Preview what would be cancelled| Flag | Description | Default |
|---|---|---|
| --coin | Cancel orders for a specific coin only | — |
| --oid | Cancel a specific order by ID | — |
| --all | Cancel all open orders | — |
| --dry | Show orders without cancelling | — |