POST
/
exchange
Place order
curl --request POST \
  --url https://api.hyperliquid.xyz/exchange \
  --header 'Content-Type: application/json' \
  --data '{
  "action": {
    "type": "order",
    "orders": [
      {
        "a": 0,
        "b": true,
        "p": "50000.0",
        "s": "0.01",
        "r": false,
        "t": {
          "limit": {
            "tif": "Alo"
          }
        },
        "c": "<string>"
      }
    ],
    "grouping": "na",
    "builder": {
      "b": "<string>",
      "f": 123
    }
  },
  "nonce": 1734567890123,
  "signature": {
    "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "s": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "v": 28
  },
  "vaultAddress": "0x0000000000000000000000000000000000000000",
  "expiresAfter": 123
}'
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "resting": {
            "oid": 77738308
          }
        }
      ]
    }
  }
}
This endpoint requires signature authentication. See our comprehensive Authentication via Signatures guide for implementation details.
Places one or multiple orders on the Hyperliquid exchange. Supports limit orders, market orders, and trigger orders (stop-loss/take-profit).
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

Required parameters

  • action (object, required) — The order action object containing:
    • type (string) — Must be "order"
    • orders (array) — Array of order objects with:
      • a (number) — Asset index (see asset notation below)
      • b (boolean) — Is buy order (true for buy/long, false for sell/short)
      • p (string) — Limit price (use “0” for market orders)
      • s (string) — Size in units of the base asset
      • r (boolean) — Reduce only order
      • t (object) — Order type specification:
        • For limit orders: {"limit": {"tif": "Alo" | "Ioc" | "Gtc"}}
        • For trigger orders: {"trigger": {"isMarket": boolean, "triggerPx": string, "tpsl": "tp" | "sl"}}
      • c (string, optional) — Client order ID (128-bit hex string)
    • grouping (string) — Order grouping: "na" | "normalTpsl" | "positionTpsl"
    • builder (object, optional) — Builder fee configuration:
      • b (string) — Builder address to receive fees
      • f (number) — Fee in tenths of a basis point
  • nonce (number, required) — Current timestamp in milliseconds (must be recent)
  • signature (object, required) — EIP-712 signature of the action

Optional parameters

  • vaultAddress (string, optional) — Address when trading on behalf of a vault or subaccount
  • expiresAfter (number, optional) — Timestamp in milliseconds after which the order is rejected

Asset notation

For perpetuals, use the index from the universe field in the meta response. For spot assets, use 10000 + index where index is from spotMeta.universe. Example: PURR/USDC spot has index 0 in spot metadata, so use asset 10000.

Order types

Time in Force (TIF) for limit orders

  • Alo — Add liquidity only (post-only), canceled if would immediately match
  • Ioc — Immediate or cancel, unfilled portion canceled
  • Gtc — Good til canceled, rests on book until filled or canceled

Trigger orders

  • tp — Take profit order
  • sl — Stop loss order
  • isMarket — Whether to place market order when triggered
  • triggerPx — Price at which to trigger the order

Returns

Returns an object with order placement status:
  • status"ok" if successful
  • response — Contains order details:
    • type"order"
    • data.statuses — Array of status objects for each order:
      • resting — Order placed on book with oid (order ID)
      • filled — Order immediately filled with totalSz, avgPx, and oid
      • error — Error message if order failed

Example request

curl -X POST https://api.hyperliquid.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "order",
      "orders": [{
        "a": 0,
        "b": true,
        "p": "50000",
        "s": "0.01",
        "r": false,
        "t": {"limit": {"tif": "Gtc"}}
      }],
      "grouping": "na"
    },
    "nonce": 1234567890123,
    "signature": {...}
  }'

Response examples

Successful resting order

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [{
        "resting": {
          "oid": 77738308
        }
      }]
    }
  }
}

Filled order

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [{
        "filled": {
          "totalSz": "0.02",
          "avgPx": "1891.4",
          "oid": 77747314
        }
      }]
    }
  }
}

Error response

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [{
        "error": "Order must have minimum value of $10."
      }]
    }
  }
}

Use cases

  • Spot and perpetual trading — Execute trades on Hyperliquid’s order books
  • Algorithmic trading — Place orders programmatically with custom logic
  • Risk management — Set stop-loss and take-profit orders
  • Market making — Place limit orders to provide liquidity
Orders consume address-based rate limits. The expiresAfter field consumes 5x rate limit when orders expire due to staleness.
Always ensure your system clock is synchronized. Nonce must be within a reasonable time window of the current server time or the request will be rejected.

Body

application/json

Response

200 - application/json

Order placement result

The response is of type object.