Trade perpetuals
Open, modify, and close perpetual positions on Hyperliquid through the mm perps commands.
Ask your agent
You (to your agent): "Open a 5x long on BTC with $100 on Hyperliquid"
You (to your agent): "Close my BTC perp position on Hyperliquid"
Your agent deposits if needed, fetches a quote, confirms details with you, then executes.
Prerequisites
- Quickstart completed
- USDC on a supported source chain for the initial deposit
First-time setup
-
List venues:
mm perps list-venues -
Deposit USDC into the venue before your first trade:
mm perps deposit --venue hyperliquid --amount <AMOUNT> -
Confirm your perpetuals balance (defaults to the main Hyperliquid DEX):
mm perps balance --venue hyperliquidTo query a HIP-3 DEX or aggregate across DEXs:
mm perps balance --venue hyperliquid --dex <DEX_NAME>mm perps balance --venue hyperliquid --all-dexesmm perps positions --venue hyperliquid --all-dexes
Open a position
-
List markets:
mm perps markets --venue hyperliquid -
Get a quote:
mm perps quote --venue hyperliquid --symbol <SYMBOL> --side long --size <SIZE> --leverage <N> -
Open the position:
mm perps open --venue hyperliquid --symbol <SYMBOL> --side long --size <SIZE> --leverage <N>Add
--dry-runto preview without submitting. Add--yesto skip interactive confirmation in scripted flows.
Close or modify a position
mm perps close --venue hyperliquid --symbol <SYMBOL>
mm perps modify --venue hyperliquid --symbol <SYMBOL> --leverage <N>
Common pitfalls
The Hyperliquid sub-account is empty on first use. Running mm perps open before depositing can
fail with HYPERLIQUID_ERROR or ORDER_REJECTED. mm perps deposit sources USDC from Arbitrum by
default. Deposit with mm perps deposit --venue hyperliquid --amount <N> before opening your first
position. If your perp account is short on collateral, run mm perps deposit or
mm perps transfer --venue hyperliquid --amount <N> --direction spot-to-perp.
Related commands
See mm perps in the commands reference.