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

# Trade Updates

> Subscribe to real-time trade updates

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](/api-reference/get-trades) for the format of the message.

***

<CodeGroup>
  ```javascript JavaScript theme={null}
  // 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();
  ```

  ```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: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": "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"
}
```
