Orders Channel

Real-time order updates with initial snapshot.

Channel: orders
Authentication: Required


Subscribe

{
  "method": "subscribe",
  "params": {
    "channel": "orders",
    "market_ids": [1, 2],
    "makers": ["0x1234567890123456789012345678901234567890"]
  }
}
ParameterTypeRequiredDescription
market_idsnumber[]NoFilter by market IDs. Empty = all markets
makersstring[]NoFilter by maker addresses. Empty = authenticated account only

Message Format

Snapshot

Sent immediately after subscribing. Contains all active (OPEN) orders matching your filters.

{
  "method": "snapshot",
  "channel": "orders",
  "type": "snapshot",
  "data": [
    {
      "@type": "type.googleapis.com/boom.v1.api.Order",
      "id": "123456789",
      "price": "50000000000000000000000",
      "size": "1000000000000000000",
      "market_id": "1",
      "side": "BUY",
      "type": "LIMIT",
      "time_in_force": "GTC",
      "expiry": 0,
      "post_only": false,
      "reduce_only": false,
      "cancel_reason": "",
      "block_number": "12345678",
      "log_index": "0",
      "stp_mode": "EXPIRE_TAKER",
      "filled_size": "0",
      "status": "ORDER_STATUS_OPEN",
      "sender": "0x1234567890123456789012345678901234567890",
      "fee_bps": "5",
      "avg_price": "0",
      "cancel_requested": false,
      "created_at": "1703123456000000000",
      "tx_hash": "0xabc123...",
      "cancel_requested_at": "0",
      "cancel_tx_hash": ""
    }
  ],
  "order_count": 1,
  "timestamp": "1703123456123456789"
}

Update

Sent when an order is placed, filled, or cancelled.

{
  "channel": "orders",
  "type": "update",
  "market_id": "1",
  "data": [
    {
      "@type": "type.googleapis.com/boom.v1.api.Order",
      "id": "123456789",
      "price": "50000000000000000000000",
      "size": "1000000000000000000",
      "market_id": "1",
      "side": "BUY",
      "type": "LIMIT",
      "time_in_force": "GTC",
      "expiry": 0,
      "post_only": false,
      "reduce_only": false,
      "cancel_reason": "",
      "block_number": "12345679",
      "log_index": "1",
      "stp_mode": "EXPIRE_TAKER",
      "filled_size": "500000000000000000",
      "status": "ORDER_STATUS_OPEN",
      "sender": "0x1234567890123456789012345678901234567890",
      "fee_bps": "5",
      "avg_price": "50000000000000000000000",
      "cancel_requested": false,
      "created_at": "1703123456000000000",
      "tx_hash": "0xdef456...",
      "cancel_requested_at": "0",
      "cancel_tx_hash": ""
    }
  ],
  "tx_hash": "0xdef456...",
  "block_number": 12345679,
  "log_index": 1,
  "block_timestamp": "1703123457000000000",
  "timestamp": "1703123457123456789"
}

Snapshot Message Fields

FieldTypeDescription
methodstringAlways "snapshot"
channelstringAlways "orders"
typestringAlways "snapshot"
dataarrayArray of Order objects
order_countnumberTotal number of orders
timestampstringServer timestamp (nanoseconds)

Update Message Fields

FieldTypeDescription
channelstringAlways "orders"
typestringAlways "update"
market_idstringMarket ID
dataarrayArray of Order objects
tx_hashstringTransaction hash
block_numbernumberBlockchain block number
log_indexnumberLog index within the block
block_timestampstringBlockchain timestamp (nanoseconds)
timestampstringServer timestamp (nanoseconds)

Order Object Fields

FieldTypeDescription
@typestringProtobuf message type
idstringUnique order ID
pricestringOrder price (wei, 18 decimals)
sizestringTotal order size (wei, 18 decimals)
market_idstringMarket ID
sidestringBUY or SELL
typestringLIMIT or MARKET
time_in_forcestringGTC, GTT, FOK, or IOC
expirynumberOrder expiry time (seconds since epoch, 0 = no expiry)
post_onlybooleanIf true, order will only be placed as maker
reduce_onlybooleanIf true, order can only reduce position
cancel_reasonstringCancellation reason (if cancelled)
block_numberstringBlock number of last update
log_indexstringLog index within the block
stp_modestringSelf-trade prevention mode (see below)
filled_sizestringAmount already filled (wei, 18 decimals)
statusstringOrder status (see below)
senderstringOrder owner address
fee_bpsstringFee rate in basis points
avg_pricestringAverage fill price (wei, 18 decimals)
cancel_requestedbooleanIf true, cancel has been requested
created_atstringCreation timestamp (nanoseconds)
tx_hashstringTransaction hash of last update
cancel_requested_atstringCancel request timestamp (nanoseconds)
cancel_tx_hashstringTransaction hash of cancel request

Order Status

StatusDescription
ORDER_STATUS_NONEUnknown status
ORDER_STATUS_OPENOrder is active and can be filled
ORDER_STATUS_FILLEDOrder has been completely filled
ORDER_STATUS_CANCELLEDOrder was cancelled

Order Side

SideDescription
BUYLong position
SELLShort position

Order Type

TypeDescription
LIMITLimit order with specified price
MARKETMarket order at best available price

Time In Force

ValueDescription
GTCGood Till Cancelled
GTTGood Till Time (uses expiry field)
FOKFill Or Kill
IOCImmediate Or Cancel

Self-Trade Prevention Mode

ModeDescription
EXPIRE_MAKERCancel the maker order
EXPIRE_TAKERCancel the taker order
EXPIRE_BOTHCancel both orders
EXPIRE_NONEAllow self-trade

Examples

Subscribe to all your orders

{
  "method": "subscribe",
  "params": {
    "channel": "orders"
  }
}

Subscribe to specific markets

{
  "method": "subscribe",
  "params": {
    "channel": "orders",
    "market_ids": [1, 2]
  }
}

Subscribe to specific accounts

{
  "method": "subscribe",
  "params": {
    "channel": "orders",
    "market_ids": [1],
    "makers": ["0x1234567890123456789012345678901234567890"]
  }
}

Unsubscribe

{
  "method": "unsubscribe",
  "params": {
    "channel": "orders"
  }
}