Documentation Index
Fetch the complete documentation index at: https://docs.sx.bet/llms.txt
Use this file to discover all available pages before exploring further.
Subscribe to all trade updates on the exchange. You will receive updates when a trade is settled or a new trade is placed.
CHANNEL NAME
recent_trades:global
MESSAGE PAYLOAD FORMAT
See the trades section for the format of the message.
// To subscribe
const sub = client.newSubscription("recent_trades:global", { positioned: true, recoverable: true });
sub.on("publication", (ctx) => {
const data = ctx.data;
// message handler logic
});
sub.subscribe();
The above returns JSON structured like this:
{
"baseToken": "0x8f3Cf7ad23Cd3CaDb09735AFf958023239c6A063",
"bettor": "0x814d79A9940CbC5Af4C19cAa118EC065a77CD31f",
"stake": "999999999999999999",
"odds": "484425713316886290000",
"orderHash": "0xf7321de419b8887eafe5756d25db37ed2796dfc2495a49e266f13c8533fddb67",
"marketHash": "0x32d6c7d300dc44c795e2bdb8c735d9ad74fd2bbece89012904a5ea8ec6b566f1",
"maker": false,
"betTime": 1625668455,
"settled": false,
"bettingOutcomeOne": true,
"fillHash": "0x027f3237d9dc9dfa6068b60d852c3e972776b683a8c43b2e1a43602918de924e",
"status": "SUCCESS",
"tradeStatus": "SUCCESS"
}