> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Event trades

> Trades for all markets under one event (requires eventId/eventTicker on the trade payload).



## AsyncAPI

````yaml datastream/pm-trades.json eventTrades
id: eventTrades
title: Event trades
description: >-
  Trades for all markets under one event (requires eventId/eventTicker on the
  trade payload).
servers:
  - id: production
    protocol: wss
    host: datastream.solanatracker.io
    bindings: []
    variables:
      - id: apiKey
        description: Your unique API key from Data API subscription
        defaultValue: YOUR_DATASTREAM_KEY
        allowedValues: []
        examples: []
address: /
parameters: []
bindings: []
operations:
  - &ref_1
    id: subscribeEventTrades
    title: Subscribe event trades
    description: Subscribe to trades for one event
    type: receive
    messages:
      - &ref_4
        id: joinEventTrades
        payload:
          - name: joinEventTrades
            description: Subscribe to trades for one event
            type: object
            properties:
              - name: type
                type: string
                description: join
                required: true
              - name: room
                type: string
                description: 'Room pattern: `pm:event:{exchange}:{eventId}:trades`'
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
          properties:
            type:
              type: string
              const: join
              default: join
              x-parser-schema-id: <anonymous-schema-72>
            room:
              type: string
              description: 'Room pattern: `pm:event:{exchange}:{eventId}:trades`'
              default: pm:event:polymarket:btc-updown-5m-1785347100:trades
              x-parser-schema-id: <anonymous-schema-73>
          examples:
            - type: join
              room: pm:event:polymarket:btc-updown-5m-1785347100:trades
          x-parser-schema-id: <anonymous-schema-71>
        title: Join event trades
        description: Subscribe to trades for one event
        example: |-
          {
            "type": "join",
            "room": "pm:event:polymarket:btc-updown-5m-1785347100:trades"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: joinEventTrades
          - id: x-parser-message-name
            value: joinEventTrades
    bindings: []
    extensions: &ref_0
      - id: x-displayName
        value: Event Trades
      - id: x-parser-unique-object-id
        value: eventTrades
  - &ref_3
    id: receiveEventTradesMessage
    title: Receive event trades message
    description: Receive Event Trades updates
    type: send
    messages:
      - &ref_6
        id: eventTradesMessage
        payload:
          - name: eventTradesMessage
            description: Event Trades update
            type: object
            properties:
              - name: type
                type: string
                description: message
                required: false
              - name: room
                type: string
                required: false
              - name: data
                type: object
                description: >-
                  Flat room data. Envelope fields plus event-specific fields
                  (trade/price/orderbook/…) at the top level.
                required: false
                properties:
                  - name: type
                    type: string
                    description: >-
                      Event kind (trade, price, orderbook_snapshot, quote,
                      crypto_price, …)
                    required: true
                  - name: channel
                    type: string
                    enumValues:
                      - prices
                      - trades
                      - orderbook
                      - quotes
                      - volume
                      - market_lifecycle
                      - resolution
                    required: true
                  - name: exchange
                    type: string
                    enumValues:
                      - kalshi
                      - polymarket
                    required: true
                  - name: marketId
                    type: string
                    required: true
                  - name: eventId
                    type: string
                    required: false
                  - name: seriesId
                    type: string
                    required: false
                  - name: category
                    type: string
                    required: false
                  - name: sport
                    type: string
                    required: false
                  - name: sourceId
                    type: string
                    description: Exchange/source idempotency key (omit when empty)
                    required: false
                  - name: timestamp
                    type: integer
                    description: Unix epoch milliseconds
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              const: message
              x-parser-schema-id: <anonymous-schema-78>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-79>
            data:
              type: object
              description: >-
                Flat room data. Envelope fields plus event-specific fields
                (trade/price/orderbook/…) at the top level.
              additionalProperties: true
              required:
                - type
                - channel
                - exchange
                - marketId
                - timestamp
              properties:
                type:
                  type: string
                  description: >-
                    Event kind (trade, price, orderbook_snapshot, quote,
                    crypto_price, …)
                  x-parser-schema-id: <anonymous-schema-10>
                channel:
                  type: string
                  enum:
                    - prices
                    - trades
                    - orderbook
                    - quotes
                    - volume
                    - market_lifecycle
                    - resolution
                  x-parser-schema-id: <anonymous-schema-11>
                exchange:
                  type: string
                  enum:
                    - kalshi
                    - polymarket
                  x-parser-schema-id: <anonymous-schema-12>
                marketId:
                  type: string
                  x-parser-schema-id: <anonymous-schema-13>
                eventId:
                  type: string
                  x-parser-schema-id: <anonymous-schema-14>
                seriesId:
                  type: string
                  x-parser-schema-id: <anonymous-schema-15>
                category:
                  type: string
                  x-parser-schema-id: <anonymous-schema-16>
                sport:
                  type: string
                  x-parser-schema-id: <anonymous-schema-17>
                sourceId:
                  type: string
                  description: Exchange/source idempotency key (omit when empty)
                  x-parser-schema-id: <anonymous-schema-18>
                timestamp:
                  type: integer
                  description: Unix epoch milliseconds
                  x-parser-schema-id: <anonymous-schema-19>
              x-parser-schema-id: RealtimeData
          examples:
            - type: message
              room: pm:event:polymarket:btc-updown-5m-1785347100:trades
              data:
                type: trade
                channel: trades
                exchange: polymarket
                marketId: '1234567890'
                timestamp: 1785347120123
          x-parser-schema-id: <anonymous-schema-77>
        title: Event trades message
        description: Event Trades update
        example: |-
          {
            "type": "message",
            "room": "pm:event:polymarket:btc-updown-5m-1785347100:trades",
            "data": {
              "type": "trade",
              "channel": "trades",
              "exchange": "polymarket",
              "marketId": "1234567890",
              "timestamp": 1785347120123
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: eventTradesMessage
          - id: x-parser-message-name
            value: eventTradesMessage
    bindings: []
    extensions: *ref_0
  - &ref_2
    id: unsubscribeEventTrades
    title: Unsubscribe event trades
    description: Unsubscribe from Event Trades
    type: receive
    messages:
      - &ref_5
        id: leaveEventTrades
        payload:
          - name: leaveEventTrades
            description: Unsubscribe from Event Trades
            type: object
            properties:
              - name: type
                type: string
                description: leave
                required: true
              - name: room
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
          properties:
            type:
              type: string
              const: leave
              default: leave
              x-parser-schema-id: <anonymous-schema-81>
            room:
              type: string
              default: pm:event:polymarket:btc-updown-5m-1785347100:trades
              x-parser-schema-id: <anonymous-schema-82>
          examples:
            - type: leave
              room: pm:event:polymarket:btc-updown-5m-1785347100:trades
          x-parser-schema-id: <anonymous-schema-80>
        title: Leave event trades
        description: Unsubscribe from Event Trades
        example: |-
          {
            "type": "leave",
            "room": "pm:event:polymarket:btc-updown-5m-1785347100:trades"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: leaveEventTrades
          - id: x-parser-message-name
            value: leaveEventTrades
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
  - *ref_5
receiveMessages:
  - *ref_6
extensions:
  - id: x-displayName
    value: Event Trades
  - id: x-parser-unique-object-id
    value: eventTrades
securitySchemes:
  - id: apiKeyAuth
    name: apiKey
    type: httpApiKey
    description: >-
      API key for authentication. Include your Datastream key in the connection
      URL: wss://datastream.solanatracker.io/{DATASTREAM_KEY}
    in: header
    extensions: []

````