Order Commands

What is an order?

An order is an instruction to buy or sell an asset on Hyperliquid. In perpetual futures, placing a buy order opens a long position (you profit if the price goes up), and placing a sell order opens a short position (you profit if the price goes down). You can also use orders to close a position you already have open.

There are two main order types: market orders and limit orders.

Market orders

A market order executes immediately at the best available price. You are not choosing a specific price, you are saying "fill this now." Market orders are useful when speed matters more than getting a precise entry price.

Use buy or long to go long. Use sell or short to go short.

To place a market order:

byreal-perps-cli order market long 0.01 BTC
byreal-perps-cli order market short 1 ETH

You can attach a take-profit and stop-loss at the same time using --tp and --sl. This places your main order alongside two conditional trigger orders as a group, so your exits are set from the moment the trade opens:

byreal-perps-cli order market long 0.01 BTC --tp 110000 --sl 90000

See the TP/SL guide for a full explanation of how these work.

Limit orders

A limit order sits in the order book and waits until the market reaches the price you set. You are saying "only fill this at my price or better." Limit orders are useful when you want to enter at a specific level rather than whatever the market is at right now.

Limit orders stay open until they are filled or you cancel them (good-till-cancelled by default).

You can change how long the order stays open with --tif. Options are Gtc (good-till-cancelled, the default), Ioc (immediate-or-cancel, fills what it can and cancels the rest), and Alo (add-liquidity-only, only fills if it can go on the book without immediately matching).

Managing open orders

To view all your open orders, run byreal-perps-cli order list.

To cancel a specific order, you need the coin name and the order ID: byreal-perps-cli order cancel BTC 123456789.

To cancel all open orders at once, run byreal-perps-cli order cancel-all -y. The -y flag confirms the action since cancelling all orders is irreversible.

Order commands summary

Command
Description

order market <side> <size> <coin>

Place a market order that fills immediately

order limit <side> <size> <coin> <price>

Place a limit order at a specific price

order list

View all open orders

order cancel <coin> <order-id>

Cancel a specific order

order cancel-all -y

Cancel all open orders