Diff-Orders Channel

This article explains the subscription and server messages produced in the Diff-Orders channel.

Subscription Messages

Subscription messages have the following formats:

websocket.send (JSON.stringify(
  { action: 'subscribe', 
    book: 'btc_mxn', 
    type: 'diff-orders' }))
{
   "action": "subscribe",
   "response": "ok",
   "time": 1455831538047,
   "type": "diff-orders"
}

Server JSON Messages

The server's returned payload contains an array with one or more orders of the following form:

Field NameDescriptionTypeUnits
aThe amountStringMajor
dUnix timestampNumberMilliseconds
oOrder IDString-
rThe rateStringMinor
sOrder statusString-
tPossible values:
- 0 indicates buy
- 1 indicates sell
Number-
vThe valueStringMinor
zTimestamp of the last update (excluding Open orders)NumberMilliseconds

Example of Server Messages

Messages on the Diff-Orders channel for open and cancelled orders look like this:

{
  "type": "diff-orders",
  "book": "btc_mxn",
  "sequence": 2734,
  "payload": [
    {
      "o": "laasdqw1ywYgfYI2",
      "d": 1675555546102,
      "r": "22222",
      "t": 0,
      "a": "0.25",
      "v": "5312.25",
      "s": "open"
    }
  ],
  "sent": 1675555546102
}
{
  "type": "diff-orders",
  "book": "btc_mxn",
  "sequence": 2222,
  "payload": [
      {
        "o": "laasdqw1ywYgfYI2",
        "d": 1677784699999,
        "r": "444444",
        "t": 1,
        "s": "cancelled",
        "z": 1912784699999
      }
  ],
  "sent": 1675555546102
}