> ## 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.

# Consolidated Trade Updates

> Subscribe to real-time consolidated trade updates

Subscribe to all consolidated trade updates on the exchange. You will receive updates when a consolidated trade is settled or a new consolidated trade is available.

**CHANNEL NAME**

`recent_trades_consolidated:global`

**MESSAGE PAYLOAD FORMAT**

See [the trades section](/api-reference/get-trades-consolidated) for the format of the message.

***

<CodeGroup>
  ```javascript JavaScript theme={null}
  // To subscribe
  const sub = client.newSubscription("recent_trades_consolidated:global", { positioned: true, recoverable: true });

  sub.on("publication", (ctx) => {
    const data = ctx.data;
    // message handler logic
  });

  sub.subscribe();
  ```

  ```python Python theme={null}
  import asyncio
  from centrifuge import Client, PublicationContext, SubscriptionEventHandler

  async def on_publication(ctx: PublicationContext) -> None:
      print(ctx.data)

  async def main():
      client = Client(
          "wss://realtime.sx.bet/connection/websocket",
          token="YOUR_TOKEN",  # from /user/realtime-token/api-key
      )
      await client.connect()
      handler = SubscriptionEventHandler(on_publication=on_publication)
      sub = client.new_subscription("recent_trades_consolidated:global", handler)
      await sub.subscribe()
      await asyncio.Future()  # keep running

  asyncio.run(main())
  ```
</CodeGroup>

The above returns JSON structured like this:

```json theme={null}
{
  "baseToken": "0x5147891461a7C81075950f8eE6384e019e39ab90",
  "tradeStatus": "PENDING",
  "bettor": "0x1562258769E6c0527bd83502E9dfc803929fa446",
  "totalStake": "10.0",
  "weightedAverageOdds": "707500000000000000000",
  "marketHash": "0x5bea2dc8ad1be455547d1ed043cea34457c0b49a4f6aad0d4ddcb19107e9057f3",
  "maker": false,
  "settled": false,
  "fillHash": "0xd81d39b80f1336affc84c6f03944ad5bc6d6ee1cd7a6ba8318595812d8ad11c7",
  "gameLabel": "Andrey Rublev vs Fabian Marozsan",
  "sportXeventId": "L13351999",
  "gameTime": "2024-07-25T16:00:00.000Z",
  "leagueLabel": "ATP Umag",
  "bettingOutcomeLabel": "Andrey Rublev",
  "bettingOutcome": 1,
  "chainVersion": "SXN"
}
```
