Skip to main content
POST
/
order
curl -X POST https://exchange-api.bulk.trade/api/v1/order \
  -H "Content-Type: application/json" \
  -d '{"actions":[{"l":{"c":"BTC-USD","b":true,"px":100000.0,"sz":0.1,"tif":"GTC","r":false}}],"nonce":1704067200000,"account":"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7","signer":"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7","signature":"5j7s...base58..."}'
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "resting": {
            "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"
          }
        }
      ]
    }
  }
}
All order operations use the unified POST /order endpoint. Send a transaction with an actions array; each action is a tagged object (e.g. {"l": {...}} for a limit order).
See Transaction Signing for how to sign requests. Use a unique nonce (e.g. nanoseconds): BigInt(Date.now()) * 1_000_000n.

Transaction Envelope

Every request to POST /order has this shape:
{
  "actions": [Action, ...],
  "nonce": 1704067200000,
  "account": "base58_pubkey",
  "signer": "base58_pubkey",
  "signature": "base58_signature"
}
FieldDescription
actionsArray of action objects (see below). Order/cancel/modify use l, m, mod, cx, cxa.
nonceUnique value for replay protection (e.g. timestamp in nanoseconds).
accountAccount public key (base58) — whose account is traded.
signerSigner public key (base58) — who is signing (usually same as account).
signatureEd25519 signature (base58).

Place Limit Order (l)

GTC (Good Till Cancel)

Standard limit order that rests on the book.
{
  "actions": [
    {"l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.1, "tif": "GTC", "r": false}}
  ],
  "nonce": 1704067200000,
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7sVt3k2YxPqH4w..."
}

IOC (Immediate or Cancel)

Fills immediately or cancels the unfilled portion.
{"l": {"c": "BTC-USD", "b": true, "px": 105000.0, "sz": 0.1, "tif": "IOC", "r": false}}

ALO (Add Liquidity Only / Post-Only)

Maker only; rejected if it would cross the spread.
{"l": {"c": "BTC-USD", "b": true, "px": 99000.0, "sz": 0.1, "tif": "ALO", "r": false}}

Limit Order Fields

FieldTypeDescription
cstringSymbol (e.g. “BTC-USD”)
bbooleantrue = buy, false = sell
pxnumberLimit price
sznumberSize/quantity
tifstringTime in force: "GTC", "IOC", "ALO"
rbooleanReduce-only

Place Market Order (m)

Executes at best available price immediately.
{
  "actions": [
    {"m": {"c": "BTC-USD", "b": true, "sz": 0.1, "r": false}}
  ],
  "nonce": 1704067200001,
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7sVt3k2YxPqH4w..."
}
FieldTypeDescription
cstringSymbol
bbooleantrue = buy, false = sell
sznumberSize/quantity
rbooleanReduce-only

Modify Order (mod)

Change the size of an existing resting order.
{
  "actions": [
    {"mod": {"oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F", "symbol": "BTC-USD", "amount": 0.05}}
  ],
  "nonce": 1704067200008,
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7s..."
}
FieldTypeDescription
oidstringOrder ID (base58 hash)
symbolstringSymbol
amountnumberNew order size

Cancel Single Order (cx)

Cancel a specific order by ID.
{
  "actions": [
    {"cx": {"c": "BTC-USD", "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"}}
  ],
  "nonce": 1704067200002,
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7s..."
}
FieldDescription
cSymbol
oidOrder ID to cancel (base58)

Cancel All Orders (cxa)

Cancel all in one symbol

{"cxa": {"c": ["BTC-USD"]}}

Cancel all across all symbols

{"cxa": {"c": []}}
FieldDescription
cArray of symbols; use [] to cancel all symbols.

Batch Actions

Send multiple actions in one transaction (e.g. cancel + place).
{
  "actions": [
    {"cx": {"c": "BTC-USD", "oid": "old_order_hash_base58"}},
    {"l": {"c": "BTC-USD", "b": true, "px": 99000.0, "sz": 0.05, "tif": "GTC", "r": false}},
    {"l": {"c": "BTC-USD", "b": false, "px": 101000.0, "sz": 0.05, "tif": "GTC", "r": false}}
  ],
  "nonce": 1704067200007,
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7s..."
}

Response Format

All submissions return an OrderResponse with one status per execution event:
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [Status, ...]
    }
  }
}

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{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?}
errorGeneric error{message}

Response Examples

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

Body

application/json

Unified signed transaction. All state-mutating operations use this model.

The actions array can contain any combination of action types, executed atomically.

Must be signed - see http-readme.md for signing details.

actions
(Limit order (l) · object | Market order (m) · object | Modify order (mod) · object | Cancel order (cx) · object | Cancel all (cxa) · object | Faucet (faucet) · object | Agent wallet (agentWalletCreation) · object | Update user settings (updateUserSettings) · object | Whitelist faucet (admin) · object | Oracle price (px, admin) · object | Pyth oracle batch (o, admin) · object)[]
required

Array of actions to execute atomically. Each action is a tagged object where the key is the compact action tag.

Action types: l, m, mod, cx, cxa, faucet, agentWalletCreation, updateUserSettings, whitelistFaucet (admin), px (admin), o (admin)

One action in the actions array. Exactly one of the following keys must be present: l, m, mod, cx, cxa, faucet, agentWalletCreation, updateUserSettings, (or admin: whitelistFaucet, px, o).

nonce
integer<int64>
required

Unique nonce for replay protection (use timestamp in nanoseconds or incrementing counter)

account
string
required

Account public key (base58) - whose account is being acted on

Example:

"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"

signer
string
required

Signer public key (base58) - who is signing (usually same as account, or authorized agent)

Example:

"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"

signature
string
required

Ed25519 signature of bincode_serialize(actions) + nonce_le_u64 + account_pubkey_bytes (base58)

Example:

"5j7sVt3k2YxPqH4w..."

Response

Transaction accepted. One status per execution event in response.data.statuses.

Response from POST /order. One entry in response.data.statuses per execution event (e.g. one per order placed, or one for faucet/agent/settings). Status variants: resting, working, filled, partiallyFilled, cancelled, cancelledRiskLimit, cancelledSelfCrossing, cancelledReduceOnly, cancelledIOC, rejectedCrossing, rejectedDuplicate, rejectedRiskLimit, rejectedInvalid, deposit, depositFailed, agentWallet, agentWalletFailed, cancelOneRejected, cancelAllRejected, error.

status
enum<string>
required

Top-level status (ok when request was accepted; check each item in statuses for per-action result)

Available options:
ok,
error
response
object
required