Skip to main content
All trading operations require Ed25519 signatures and a unique nonce for replay protection. See Transaction Signing for the canonical message format and Place & Cancel Orders for the full transaction envelope.

Post Request Format

All order and trading-related operations use the post method with the unified transaction payload:
{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [Action, ...],
      "nonce": 1704067200000000000,
      "account": "base58_pubkey",
      "signer": "base58_pubkey",
      "signature": "base58_signature"
    }
  },
  "id": 1
}
Transaction fields:
FieldDescription
actionsArray of actions to execute atomically (see Action types below)
nonceUnique integer (u64) for replay protection (e.g. timestamp in nanoseconds)
accountAccount public key (base58) — whose account is being traded
signerSigner public key (base58) — who is signing (usually same as account, or authorized agent)
signatureEd25519 signature (base58) over the signed message
Signing: The signed message is bincode_serialize(actions) + nonce_le_u64 + account_pubkey_bytes. Signer is not part of the signed message. See Transaction Signing for details.

Action Types

Each action in the actions array is a single-key object. The key is the action tag, the value is the action payload.
ActionDescriptionExample
lLimit order{"l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.1, "tif": "GTC", "r": false}}
mMarket order{"m": {"c": "BTC-USD", "b": true, "sz": 0.1, "r": false}}
modModify order size{"mod": {"oid": "base58_hash", "symbol": "BTC-USD", "amount": 0.05}}
cxCancel one order{"cx": {"c": "BTC-USD", "oid": "base58_hash"}}
cxaCancel all orders{"cxa": {"c": ["BTC-USD"]}} or {"cxa": {"c": []}} for all symbols
Other actions (faucet, updateUserSettings, agentWalletCreation) use the same post format and are documented on Request Faucet, Update User Settings, and Manage Agent Wallet.

Place Limit Order

{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.1, "tif": "GTC", "r": false}}
      ],
      "nonce": 1704067200000000000,
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 1
}
Limit order (l) fields: c (symbol), b (true = buy), px (limit price), sz (size), tif (time in force), r (reduce-only). Time in force: GTC (good till cancel, rests on book), IOC (immediate or cancel), ALO (add liquidity only / post-only; rejects if would cross).

Place Market Order

{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"m": {"c": "BTC-USD", "b": true, "sz": 0.1, "r": false}}
      ],
      "nonce": 1704067200000000000,
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 2
}
Market order (m) fields: c (symbol), b (true = buy), sz (size), r (reduce-only).

Modify Order

Change the size of an existing order:
{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"mod": {"oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F", "symbol": "BTC-USD", "amount": 0.05}}
      ],
      "nonce": 1704067200000000000,
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 3
}
Modify (mod) fields: oid (order ID, base58), symbol, amount (new size).

Cancel Order

{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"cx": {"c": "BTC-USD", "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"}}
      ],
      "nonce": 1704067200000000000,
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 4
}

Cancel All Orders

Cancel all in one or more symbols: use cxa with c = array of symbols. Cancel all across all symbols: use cxa with c = [].
{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [{"cxa": {"c": ["BTC-USD"]}}],
      "nonce": 1704067200000000000,
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 5
}

Batch Actions

Multiple actions can be combined in a single transaction (same nonce, account, signer, signature). One status is returned per action/event. Example: cancel one order and place two new limit orders
{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"cx": {"c": "BTC-USD", "oid": "old_order_id_base58"}},
        {"l": {"c": "BTC-USD", "b": true, "px": 99900.0, "sz": 0.05, "tif": "GTC", "r": false}},
        {"l": {"c": "BTC-USD", "b": false, "px": 100100.0, "sz": 0.05, "tif": "GTC", "r": false}}
      ],
      "nonce": 1704067200000000000,
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 7
}

Response Format

FieldDescription
typeAlways "post" for trading responses
idRequest ID (matches the request)
data.typeAlways "action"
data.payload.status"ok" or "error"
data.payload.response.typeResponse type (e.g., "order")
data.payload.response.data.statusesArray of status objects (one per order)

Status Types

Non-Terminal (Order Still Active)

StatusDescriptionFields
restingOrder placed and resting on book{oid}
workingPartial fills, still resting{oid, filledSz, remainingSz, vwap}

Terminal (Order Complete)

StatusDescriptionFields
filledOrder fully filled{oid, totalSz, avgPx}
partiallyFilledPartially filled and terminal{oid, totalSz, avgPx}
cancelledCancelled by user{oid}
cancelledRiskLimitCancelled - risk limit{oid, reason?}
cancelledSelfCrossingCancelled - self-crossing (STP){oid}
cancelledReduceOnlyCancelled - would increase position{oid}
cancelledIOCIOC expired without full fill{oid, filledSz}
rejectedCrossingPost-only rejected for crossing{oid}
rejectedDuplicateDuplicate order ID{oid}
rejectedRiskLimitRejected - risk limit{oid, reason?}
rejectedInvalidInvalid parameters{oid, reason?}
depositFaucet deposit succeeded{amount}
agentWalletAgent wallet registered{agentWallet}
errorGeneric error{message}

Response Examples

{
  "type": "post",
  "id": 1,
  "data": {
    "type": "action",
    "payload": {
      "status": "ok",
      "response": {
        "type": "order",
        "data": {
          "statuses": [{
            "working": {
              "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
              "filledSz": 0.05,
              "remainingSz": 0.05,
              "vwap": 100000.0
            }
          }]
        }
      }
    }
  }
}

Error Handling

Ensure you’re using the correct serialization format including nonce. Use official SDKs when possible.
If the signer is different from the account, the signer must be registered as an agent for that account. See Manage Agent Wallet (same transaction envelope, agentWalletCreation action).
Check your available balance before placing orders. Consider position size and leverage.
Each nonce can only be used once. Use nanosecond timestamps: BigInt(Date.now()) * 1_000_000n.
Verify order parameters meet market requirements (min size, tick size, etc).