Skip to main content
This WebSocket API will be deprecated on July 1, 2026. See the Migration Guide to move to the Centrifuge-based API.
Subscribe to best odds changes in a particular order book for the given base token. You will receive updates when orders are filled, cancelled, or posted. Note that for performance reasons, updates are delayed by at most 100ms. CHANNEL NAME FORMAT best_odds:{baseToken}
NameTypeDescription
baseTokenstringRestrict updates to only orders denominated in this token
MESSAGE PAYLOAD FORMAT The message payload is an array of JSON objects representing each object with the fields below.
NameTypeDescription
baseTokenstringThe token for the best odds result order
marketHashstringThe market for the best odds result
isMakerBettingOutcomeOnebooleanWhether or not the maker is betting outcome one. If false, maker is betting outcome two.
percentageOddsstringThe odds that the maker receives in the sportx protocol format. To convert to an implied odds divide by 10^20. To convert to the odds that the taker would receive if this order would be filled in implied format, use the formula takerOdds=1-percentageOdds/10^20. See the unit conversion section for more details.
updatedAtnumberThe timestamp in milliseconds for when the odds became the best
Note that the messages are sent in batches in an array. If you receive two updates for the same orderHash within an update, you can order them by updateTime after converting the updateTime to a BigInt or BigNumber.
const baseToken = "0xa25dA0331C0853FD17C47c8c34BCCBAaF516C438";
const channel = realtime.channels.get(`best_odds:${baseToken}`);
channel.subscribe((message) => {
  console.log(message.data);
});
The above command returns JSON structured like this
[
  {
    "baseToken": "0x1BC6326EA6aF2aB8E4b68c83418044B1923b2956",
    "marketHash": "0xddaf2ef56d0db2317cf9a1e1dde3de2f2158e28bee55fe35a684389f4dce0cf6",
    "isMakerBettingOutcomeOne": true,
    "percentageOdds": "750000000000000000000",
    "updatedAt": 1747500000000
  }
]