Public order book

Subscribe

Request

{
  "t": "ACETO/USD@depth@100ms",
  "e": "tdx:subscribe"
}

Replies

FieldDescription
uLower bound sequence.
UUpper bound sequence.
bBids as an array of book entries.
aAsks as an array of book entries.
bookEntry.0Price of the entry.
bookEntry.1Quantity of the entry.

Initialization

{
  "t": "ACETO/USD@depth@100ms",
  "e": "tdx:subscription_received"
}

{
  "t": "ACETO/USD@depth@100ms",
  "e": "orderbook",
  "d": {
    "u": 42,
    "b": [["120", "2"], ["121", "1"]],
    "a": [["125", "1"]]
  }
}

The order book can be maintained locally by following the updates. For instance, the order book after the replies above is constituted of:

Bid quantityBid priceAsk priceAsk quantity
21201251
1121

Updates

{
  "t": "ACETO/USD@depth@100ms",
  "e": "orderbook",
  "d": {
    "u": 43,
    "U": 45,
    "b": [["120", "0"], ["121", "3"]],
    "a": []
  }
}

An update can either change the quantity of the price when the quantity is positive, or it removes the price when the quantity is zero. After apply the update above, the order book is constituted of:

Bid quantityBid priceAsk priceAsk quantity
31211251

When an update with an upper bound sequence (U) above the latest lower bound sequence (u), it should be ignored.




  © 2018-2023 Taurus SA. All rights reserved.