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

# Trades

> Subscribe to public trade feed for outcomes. No user auth required. Uses { action: "subscribe", channel: "trades", outcomeIds } message format. Shares the 500-subscription limit with orderbook subscriptions.



## AsyncAPI

````yaml openapi/asyncapi.json trades
id: trades
title: Trades
description: >-
  Subscribe to public trade feed for outcomes. No user auth required. Uses {
  action: "subscribe", channel: "trades", outcomeIds } message format. Shares
  the 500-subscription limit with orderbook subscriptions.
servers:
  - id: production
    protocol: wss
    host: ws.agg.market
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_2
    id: subscribeTrades
    title: Subscribe trades
    description: Subscribe to public trade feed
    type: send
    messages:
      - &ref_5
        id: subscribe
        payload:
          - name: Subscribe to orderbook
            description: Subscribe to aggregated orderbook updates for markets
            type: object
            properties:
              - name: action
                type: string
                description: subscribe
                required: true
              - name: channel
                type: string
                required: true
              - name: outcomeIds
                type: array
                description: Outcome IDs to subscribe to
                required: true
                properties:
                  - name: item
                    type: string
                    required: false
        headers: []
        jsonPayloadSchema:
          title: Subscribe
          type: object
          required:
            - action
            - channel
            - outcomeIds
          properties:
            action:
              const: subscribe
              type: string
              x-parser-schema-id: <anonymous-schema-2>
            channel:
              anyOf:
                - const: orderbook
                  type: string
                  x-parser-schema-id: <anonymous-schema-4>
                - const: trades
                  type: string
                  x-parser-schema-id: <anonymous-schema-5>
              x-parser-schema-id: <anonymous-schema-3>
            outcomeIds:
              description: Outcome IDs to subscribe to
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-7>
              x-parser-schema-id: <anonymous-schema-6>
          x-parser-schema-id: <anonymous-schema-1>
        title: Subscribe to orderbook
        description: Subscribe to aggregated orderbook updates for markets
        example: |-
          {
            "action": "subscribe",
            "channel": "orderbook",
            "outcomeIds": [
              "clv2abc123def456",
              "clv2xyz789ghi012"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: trades
  - &ref_3
    id: unsubscribeTrades
    title: Unsubscribe trades
    description: Unsubscribe from trade feed
    type: send
    messages:
      - &ref_6
        id: unsubscribe
        payload:
          - name: Unsubscribe from orderbook
            type: object
            properties:
              - name: action
                type: string
                description: unsubscribe
                required: true
              - name: channel
                type: string
                required: true
              - name: outcomeIds
                type: array
                description: Outcome IDs to unsubscribe from
                required: true
                properties:
                  - name: item
                    type: string
                    required: false
        headers: []
        jsonPayloadSchema:
          title: Unsubscribe
          type: object
          required:
            - action
            - channel
            - outcomeIds
          properties:
            action:
              const: unsubscribe
              type: string
              x-parser-schema-id: <anonymous-schema-9>
            channel:
              anyOf:
                - const: orderbook
                  type: string
                  x-parser-schema-id: <anonymous-schema-11>
                - const: trades
                  type: string
                  x-parser-schema-id: <anonymous-schema-12>
              x-parser-schema-id: <anonymous-schema-10>
            outcomeIds:
              description: Outcome IDs to unsubscribe from
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-14>
              x-parser-schema-id: <anonymous-schema-13>
          x-parser-schema-id: <anonymous-schema-8>
        title: Unsubscribe from orderbook
        example: |-
          {
            "action": "unsubscribe",
            "channel": "orderbook",
            "outcomeIds": [
              "clv2abc123def456",
              "clv2xyz789ghi012"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribe
    bindings: []
    extensions: *ref_0
  - &ref_1
    id: receiveTrade
    title: Receive trade
    description: Public trade event from a venue
    type: receive
    messages:
      - &ref_4
        id: trade
        payload:
          - name: Trade
            description: Public trade event from a venue
            type: object
            properties:
              - name: type
                type: string
                description: trade
                required: true
              - name: outcomeId
                type: string
                required: true
              - name: channel
                type: string
                required: false
              - name: venue
                type: string
                required: true
              - name: side
                type: string
                required: true
              - name: price
                type: number
                description: Normalized 0-1 price
                required: true
              - name: size
                type: number
                description: Venue-native units
                required: true
              - name: timestamp
                type: number
                required: true
        headers: []
        jsonPayloadSchema:
          title: Trade
          type: object
          required:
            - type
            - outcomeId
            - venue
            - side
            - price
            - size
            - timestamp
          properties:
            type:
              const: trade
              type: string
              x-parser-schema-id: <anonymous-schema-171>
            outcomeId:
              type: string
              x-parser-schema-id: <anonymous-schema-172>
            channel:
              anyOf:
                - const: orderbook
                  type: string
                  x-parser-schema-id: <anonymous-schema-174>
                - const: trades
                  type: string
                  x-parser-schema-id: <anonymous-schema-175>
              x-parser-schema-id: <anonymous-schema-173>
            venue:
              type: string
              x-parser-schema-id: <anonymous-schema-176>
            side:
              anyOf:
                - const: buy
                  type: string
                  x-parser-schema-id: <anonymous-schema-178>
                - const: sell
                  type: string
                  x-parser-schema-id: <anonymous-schema-179>
              x-parser-schema-id: <anonymous-schema-177>
            price:
              description: Normalized 0-1 price
              type: number
              x-parser-schema-id: <anonymous-schema-180>
            size:
              description: Venue-native units
              type: number
              x-parser-schema-id: <anonymous-schema-181>
            timestamp:
              type: number
              x-parser-schema-id: <anonymous-schema-182>
          x-parser-schema-id: <anonymous-schema-170>
        title: Trade
        description: Public trade event from a venue
        example: |-
          {
            "type": "trade",
            "outcomeId": "clv2abc123def456",
            "channel": "orderbook",
            "venue": "polymarket",
            "side": "buy",
            "price": 0.55,
            "size": 100,
            "timestamp": 1710000000000
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: trade
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: trades
securitySchemes:
  - id: appId
    name: appId
    type: userPassword
    description: >-
      App-level auth: pass appId as a query parameter on connect. Required for
      all connections. The appId must belong to an active app with matching
      allowed origins.
    extensions: []
  - id: jwt
    name: jwt
    type: http
    description: >-
      User-level auth: pass JWT as token query param on connect, or send {
      action: 'authenticate', token } mid-session. Required for user-specific
      events (orders, balances). Same JWT as the REST API.
    scheme: bearer
    bearerFormat: JWT
    extensions: []

````