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

# Price aggregated

> Subscribe to aggregated price updates across multiple pools for a token



## AsyncAPI

````yaml datastream/prices.json priceAggregated
id: priceAggregated
title: Price aggregated
description: Subscribe to aggregated price updates across multiple pools for a token
servers:
  - id: production
    protocol: wss
    host: datastream.solanatracker.io
    bindings: []
    variables:
      - id: apiKey
        description: Your unique API key from Data API subscription
        allowedValues: []
        examples: []
address: /
parameters: []
bindings: []
operations:
  - &ref_1
    id: subscribeToPriceAggregated
    title: Subscribe to price aggregated
    description: Subscribe to aggregated price
    type: receive
    messages:
      - &ref_5
        id: joinPriceAggregated
        payload:
          - name: joinPriceAggregated
            description: Subscribe to aggregated price
            type: object
            properties:
              - name: type
                type: string
                description: join
                required: true
              - name: room
                type: string
                description: Aggregated price room (price:aggregated:{tokenAddress})
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
          properties:
            type:
              type: string
              const: join
              default: join
              x-parser-schema-id: <anonymous-schema-19>
            room:
              type: string
              pattern: ^price:aggregated:[A-Za-z0-9]{32,44}$
              description: Aggregated price room (price:aggregated:{tokenAddress})
              default: price:aggregated:So11111111111111111111111111111111111111112
              x-parser-schema-id: <anonymous-schema-20>
          examples:
            - type: join
              room: price:aggregated:So11111111111111111111111111111111111111112
          x-parser-schema-id: <anonymous-schema-18>
        title: Join price aggregated
        description: Subscribe to aggregated price
        example: |-
          {
            "type": "join",
            "room": "price:aggregated:So11111111111111111111111111111111111111112"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: joinPriceAggregated
          - id: x-parser-message-name
            value: joinPriceAggregated
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: priceAggregated
  - &ref_3
    id: receivePriceAggregatedConfirmation
    title: Receive price aggregated confirmation
    description: Receive confirmation
    type: send
    messages:
      - &ref_7
        id: priceAggregatedJoined
        payload:
          - name: priceAggregatedJoined
            description: Aggregated price subscription confirmed
            type: object
            properties:
              - name: type
                type: string
                description: joined
                required: false
              - name: room
                type: string
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              const: joined
              x-parser-schema-id: <anonymous-schema-22>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-23>
          examples:
            - type: joined
              room: price:aggregated:So11111111111111111111111111111111111111112
          x-parser-schema-id: <anonymous-schema-21>
        title: Price aggregated joined
        description: Aggregated price subscription confirmed
        example: |-
          {
            "type": "joined",
            "room": "price:aggregated:So11111111111111111111111111111111111111112"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: priceAggregatedJoined
          - id: x-parser-message-name
            value: priceAggregatedJoined
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: receivePriceAggregatedData
    title: Receive price aggregated data
    description: Receive aggregated price
    type: send
    messages:
      - &ref_8
        id: priceAggregatedMessage
        payload:
          - name: priceAggregatedMessage
            description: Aggregated price update notification
            type: object
            properties:
              - name: type
                type: string
                description: message
                required: false
              - name: room
                type: string
                required: false
              - name: data
                type: object
                required: false
                properties:
                  - name: token
                    type: string
                    description: Token address
                    required: false
                  - name: timestamp
                    type: integer
                    description: Update timestamp in milliseconds
                    required: false
                  - name: price
                    type: number
                    description: Price from the primary pool
                    required: false
                  - name: pool
                    type: string
                    description: Primary pool ID
                    required: false
                  - name: aggregated
                    type: object
                    required: false
                    properties:
                      - name: median
                        type: number
                        description: Median price across all pools
                        required: false
                      - name: average
                        type: number
                        description: Average price across all pools
                        required: false
                      - name: min
                        type: number
                        description: Minimum price across all pools
                        required: false
                      - name: max
                        type: number
                        description: Maximum price across all pools
                        required: false
                      - name: poolCount
                        type: integer
                        description: Number of pools included in aggregation
                        required: false
                  - name: topPools
                    type: array
                    description: Top pools by liquidity with their individual prices
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              const: message
              x-parser-schema-id: <anonymous-schema-25>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-26>
            data:
              type: object
              properties:
                token:
                  type: string
                  description: Token address
                  x-parser-schema-id: <anonymous-schema-27>
                timestamp:
                  type: integer
                  description: Update timestamp in milliseconds
                  x-parser-schema-id: <anonymous-schema-28>
                price:
                  type: number
                  description: Price from the primary pool
                  x-parser-schema-id: <anonymous-schema-29>
                pool:
                  type: string
                  description: Primary pool ID
                  x-parser-schema-id: <anonymous-schema-30>
                aggregated:
                  type: object
                  properties:
                    median:
                      type: number
                      description: Median price across all pools
                      x-parser-schema-id: <anonymous-schema-32>
                    average:
                      type: number
                      description: Average price across all pools
                      x-parser-schema-id: <anonymous-schema-33>
                    min:
                      type: number
                      description: Minimum price across all pools
                      x-parser-schema-id: <anonymous-schema-34>
                    max:
                      type: number
                      description: Maximum price across all pools
                      x-parser-schema-id: <anonymous-schema-35>
                    poolCount:
                      type: integer
                      description: Number of pools included in aggregation
                      x-parser-schema-id: <anonymous-schema-36>
                  x-parser-schema-id: <anonymous-schema-31>
                topPools:
                  type: array
                  description: Top pools by liquidity with their individual prices
                  items:
                    type: object
                    properties:
                      poolId:
                        type: string
                        x-parser-schema-id: <anonymous-schema-39>
                      price:
                        type: number
                        x-parser-schema-id: <anonymous-schema-40>
                      liquidity:
                        type: number
                        x-parser-schema-id: <anonymous-schema-41>
                      market:
                        type: string
                        x-parser-schema-id: <anonymous-schema-42>
                    x-parser-schema-id: <anonymous-schema-38>
                  x-parser-schema-id: <anonymous-schema-37>
              x-parser-schema-id: AggregatedPriceUpdate
          examples:
            - type: message
              room: price:aggregated:So11111111111111111111111111111111111111112
              data:
                token: So11111111111111111111111111111111111111112
                timestamp: 1762964449215
                price: 153.70666202103925
                pool: 3nMFwZXwY1s1M5s8vYAHqd4wGs4iSxXE4LRoUMMYqEgF
                aggregated:
                  median: 153.6850599485249
                  average: 153.6735820182654
                  min: 153.36863801111053
                  max: 153.71662179961638
                  poolCount: 10
                topPools:
                  - poolId: 3ucNos4NbumPLZNWztqGHNFFgkHeRMBQAVemeeomsUxv
                    price: 153.68241854665007
                    liquidity: 17950616.091940343
                    market: raydium-clmm
          x-parser-schema-id: <anonymous-schema-24>
        title: Price aggregated message
        description: Aggregated price update notification
        example: |-
          {
            "type": "message",
            "room": "price:aggregated:So11111111111111111111111111111111111111112",
            "data": {
              "token": "So11111111111111111111111111111111111111112",
              "timestamp": 1762964449215,
              "price": 153.70666202103925,
              "pool": "3nMFwZXwY1s1M5s8vYAHqd4wGs4iSxXE4LRoUMMYqEgF",
              "aggregated": {
                "median": 153.6850599485249,
                "average": 153.6735820182654,
                "min": 153.36863801111053,
                "max": 153.71662179961638,
                "poolCount": 10
              },
              "topPools": [
                {
                  "poolId": "3ucNos4NbumPLZNWztqGHNFFgkHeRMBQAVemeeomsUxv",
                  "price": 153.68241854665007,
                  "liquidity": 17950616.091940343,
                  "market": "raydium-clmm"
                }
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: priceAggregatedMessage
          - id: x-parser-message-name
            value: priceAggregatedMessage
    bindings: []
    extensions: *ref_0
  - &ref_2
    id: unsubscribeFromPriceAggregated
    title: Unsubscribe from price aggregated
    description: Unsubscribe
    type: receive
    messages:
      - &ref_6
        id: leavePriceAggregated
        payload:
          - name: leavePriceAggregated
            description: Unsubscribe from aggregated price
            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-44>
            room:
              type: string
              default: price:aggregated:So11111111111111111111111111111111111111112
              x-parser-schema-id: <anonymous-schema-45>
          examples:
            - type: leave
              room: price:aggregated:So11111111111111111111111111111111111111112
          x-parser-schema-id: <anonymous-schema-43>
        title: Leave price aggregated
        description: Unsubscribe from aggregated price
        example: |-
          {
            "type": "leave",
            "room": "price:aggregated:So11111111111111111111111111111111111111112"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: leavePriceAggregated
          - id: x-parser-message-name
            value: leavePriceAggregated
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
receiveOperations:
  - *ref_3
  - *ref_4
sendMessages:
  - *ref_5
  - *ref_6
receiveMessages:
  - *ref_7
  - *ref_8
extensions:
  - id: x-parser-unique-object-id
    value: priceAggregated
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: []

````