Skip to main content

Trade perpetuals

Open, modify, and close perpetual positions on Hyperliquid through the mm perps commands.

Prerequisites

  • Quickstart completed
  • USDC on a supported source chain for the initial deposit

First-time setup

  1. List venues:

    mm perps list-venues
  2. Deposit USDC into the venue before your first trade:

    mm perps deposit --venue hyperliquid --amount <AMOUNT>
  3. Confirm your perps balance:

    mm perps balance --venue hyperliquid

Open a position

  1. List markets:

    mm perps markets --venue hyperliquid
  2. Get a quote:

    mm perps quote --venue hyperliquid --symbol <SYMBOL> --side long --size <SIZE> --leverage <N>
  3. Open the position:

    mm perps open --venue hyperliquid --symbol <SYMBOL> --side long --size <SIZE> --leverage <N>

Close or modify a position

mm perps close --venue hyperliquid --symbol <SYMBOL>
mm perps modify --venue hyperliquid --symbol <SYMBOL> --leverage <N>

Common pitfalls

Deposit before you trade

The Hyperliquid sub-account is empty on first use. Running mm perps open before depositing can fail with:

PerpsRuntimeError: User or API Wallet does not exist

Deposit USDC with mm perps deposit --amount <N> before opening your first position.

See mm perps in the commands reference.