Skip to content
🌐Network: Mainnet

Order Actions

Raw order action payloads for POST /v1/session/actions.

For SDK-first examples, see Orders. For request signing, batching, nonce fields, and response behavior, see Execute Session Actions.

Create Order

Create an order by including a CreateOrder action inside a session actions request.

json
{
  "CreateOrder": {
    "side": "Buy",
    "price": "1000000000",
    "quantity": "5000000000",
    "order_type": "Spot"
  }
}

Fields:

FieldDescription
sideBuy or Sell.
priceRaw integer price, scaled by market precision.
quantityRaw integer quantity, scaled by market precision.
order_typeOrder execution type. See Order Types.

Use Precision & Decimals to convert human-readable prices and quantities into raw integer values.

Order Types

Set CreateOrder.order_type to one of these values:

Order TypeRaw order_type Value
Spot"Spot"
Market"Market"
Limit{ "Limit": ["1000000000", "1734876543210"] }
Post Only"PostOnly"
Fill Or Kill"FillOrKill"
Bounded Market{ "BoundedMarket": { "max_price": "1100000000", "min_price": "900000000" } }

Notes:

  • Buy limit orders execute at the limit price or lower.
  • Sell limit orders execute at the limit price or higher.
  • PostOnly reverts if any quantity would execute immediately as a taker.
  • FillOrKill fails unless the full order can execute immediately.
  • BoundedMarket requires max_price greater than or equal to min_price.

Cancel Order

Cancel an open order by including a CancelOrder action inside a session actions request.

json
{
  "CancelOrder": {
    "order_id": "0x..."
  }
}

Fields:

FieldDescription
order_idOrder ID returned by order creation, order history, or WebSocket order updates.

For low-level signing details specific to cancellation, see Cancelling an Order.

Batch Example

POST /v1/session/actions groups actions by market. A single request supports up to 5 actions total across up to 5 markets.

json
{
  "actions": [
    {
      "market_id": "0x1234567890abcdef...",
      "actions": [
        {
          "CreateOrder": {
            "side": "Buy",
            "price": "1000000000",
            "quantity": "100000000",
            "order_type": "Spot"
          }
        },
        {
          "CancelOrder": {
            "order_id": "0xabcdef..."
          }
        }
      ]
    }
  ],
  "signature": {
    "Secp256k1": "0x789..."
  },
  "nonce": "2",
  "trade_account_id": "0xdef456...",
  "session_id": {
    "Address": "0xabc123..."
  },
  "collect_orders": true
}