Skip to main content
POST
/
order
curl --request POST \
  --url https://exchange-api2.bulk.trade/api/v1/order \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": {
    "type": "order",
    "orders": [
      {
        "order": {
          "c": "BTC-USD",
          "b": true,
          "px": 100000,
          "sz": 0.1,
          "r": false,
          "t": {
            "limit": {
              "tif": "GTC"
            }
          }
        }
      }
    ],
    "nonce": 1704067200000
  },
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7s...base58..."
}
'
{
  "status": "ok",
  "response": {
    "type": "<string>",
    "data": {
      "statuses": [
        {
          "resting": {
            "oid": "<string>"
          }
        }
      ]
    }
  }
}

Place Order

Limit Order (GTC)

Standard limit order that rests on the book until filled or cancelled.
{
  "action": {
    "type": "order",
    "orders": [{
      "order": {
        "c": "BTC-USD",
        "b": true,
        "px": 100000.0,
        "sz": 0.1,
        "r": false,
        "t": { "limit": { "tif": "GTC" } }
      }
    }],
    "nonce": 1704067200000000000
  },
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7sVt3k2YxPqH4w..."
}

Limit Order (IOC)

Immediate-or-Cancel - fills immediately or cancels unfilled portion.
{
  "order": {
    "c": "BTC-USD",
    "b": true,
    "px": 105000.0,
    "sz": 0.1,
    "r": false,
    "t": { "limit": { "tif": "IOC" } }
  }
}

Limit Order (ALO / Post-Only)

Add-Liquidity-Only - only places if it would rest on book (maker only).
{
  "order": {
    "c": "BTC-USD",
    "b": true,
    "px": 99000.0,
    "sz": 0.1,
    "r": false,
    "t": { "limit": { "tif": "ALO" } }
  }
}

Market Order

Executes immediately at best available price.
{
  "order": {
    "c": "BTC-USD",
    "b": true,
    "px": 0.0,
    "sz": 0.1,
    "r": false,
    "t": {
      "trigger": {
        "is_market": true,
        "triggerPx": 0.0
      }
    }
  }
}

Order Fields

FieldTypeDescription
cstringSymbol (e.g., “BTC-USD”)
bbooleanBuy side (true = buy, false = sell)
pxnumberPrice (0.0 for market orders)
sznumberSize/quantity
rbooleanReduce-only (true = only close position)
tobjectOrder type (see below)
cloidstring?Optional client order ID (base58)

Time In Force

TIFDescription
GTCGood Till Cancel - rests on book
IOCImmediate or Cancel - fill or kill
ALOAdd Liquidity Only - post-only maker

Cancel Single Order

Cancel a specific order by order ID.
{
  "action": {
    "type": "order",
    "orders": [{
      "cancel": {
        "c": "BTC-USD",
        "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"
      }
    }],
    "nonce": 1704067200000000000
  },
  "account": "...",
  "signer": "...",
  "signature": "..."
}
FieldDescription
cSymbol
oidOrder ID to cancel (base58)

Cancel All Orders

Cancel All in Symbol

{
  "action": {
    "type": "order",
    "orders": [{
      "cancelAll": {
        "c": ["BTC-USD"]
      }
    }],
    "nonce": 1704067200000000000
  },
  "account": "...",
  "signer": "...",
  "signature": "..."
}

Cancel All Across All Symbols

{
  "action": {
    "type": "order",
    "orders": [{
      "cancelAll": {
        "c": []
      }
    }],
    "nonce": 1704067200000000000
  },
  "account": "...",
  "signer": "...",
  "signature": "..."
}

Batch Orders

Place multiple orders in a single request:
{
  "action": {
    "type": "order",
    "orders": [
      {
        "order": {
          "c": "BTC-USD",
          "b": true,
          "px": 99000.0,
          "sz": 0.05,
          "r": false,
          "t": { "limit": { "tif": "GTC" } }
        }
      },
      {
        "order": {
          "c": "BTC-USD",
          "b": false,
          "px": 101000.0,
          "sz": 0.05,
          "r": false,
          "t": { "limit": { "tif": "GTC" } }
        }
      }
    ],
    "nonce": 1704067200000000000
  },
  "account": "...",
  "signer": "...",
  "signature": "..."
}

Response 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{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

Signed transaction for placing orders.

Must be signed - see "Transaction Signing" section

action
object
required

The action to perform

account
string
required

Account public key - whose account is being traded (base58)

Example:

"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"

signer
string
required

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

Example:

"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"

signature
string
required

Ed25519 signature of bincode_serialize(action + account + signer) (base58)

Example:

"5j7sVt3k2YxPqH4w..."

Response

Order accepted

Response from order/cancel/agent wallet operations

status
enum<string>
Available options:
ok,
error
response
object