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
FlagDescriptionDefault
--coinBase token symbol (e.g., PURR, HYPE)
--sideOrder side: buy or sell (auto-set by spot-buy/spot-sell)
--sizeSize in base token units
--priceLimit price in quote token (omit for market order)
--tifTime-in-force for limit orders: Gtc, Ioc, AloGtc
--slippageSlippage tolerance in bps for market orders50
--dryPreview 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 volume

HIP-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 asset

If 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
FlagDescriptionDefault
--coinAsset to trade (ETH, BTC, SOL, HYPE, etc.)required
--sideOrder direction: buy or sell (auto-set by buy/sell command)required
--sizeOrder size in base assetrequired
--slippageSlippage tolerance in bps (basis points)50 (0.5%)
--leverageSet leverage before placing the order (cross for main perps, isolated for HIP-3)
--reduceReduce-only order (won't increase position)false
--dryPreview order details without executing
--verboseShow 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
FlagDescriptionDefault
--coinAsset to traderequired
--sideOrder direction: buy or sellrequired
--sizeOrder size in base assetrequired
--priceLimit pricerequired
--tifTime in force: GTC (rests on book), IOC (fill or cancel), ALO (post-only, maker only)GTC
--leverageSet leverage before placing the order
--reduceReduce-only orderfalse
--dryPreview without executing

Trigger Orders

Place conditional orders that activate when price reaches a trigger level. Used for stop losses, take profits, and conditional entries.

Take profit: sell HYPE when price rises to $40
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 40 --type tp
Stop loss: sell HYPE when price drops to $30
openbroker trigger --coin HYPE --side sell --size 0.5 --trigger 30 --type sl
Buy stop: buy BTC on breakout above $75k
openbroker trigger --coin BTC --side buy --size 0.01 --trigger 75000 --type sl --reduce false
FlagDescriptionDefault
--coinAsset to traderequired
--sideOrder side when triggered: buy or sellrequired
--sizeOrder size in base assetrequired
--triggerTrigger price (order activates at this level)required
--typeOrder type: tp (take profit) or sl (stop loss)required
--limitCustom limit price when triggered (overrides default)auto
--slippageSlippage for stop loss limit price in bps100 (1%)
--reduceReduce-only ordertrue
--dryPreview without placing
--verboseShow 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
FlagDescriptionDefault
--coinAsset with an open positionrequired
--tpTake profit price: absolute ($40), percentage (+10%), or "entry"
--slStop loss price: absolute ($30), percentage (-5%), or "entry"
--sizeSize to protect (partial TP/SL)full position
--sl-slippageStop loss slippage buffer in bps100 (1%)
--dryPreview orders without placing
--verboseShow 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
FlagDescriptionDefault
--coinCancel orders for a specific coin only
--oidCancel a specific order by ID
--allCancel all open orders
--dryShow orders without cancelling