> ## 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 by pool

> Subscribe to price updates for a specific pool



## AsyncAPI

````yaml datastream/prices.json priceByPool
id: priceByPool
title: Price by pool
description: Subscribe to price updates for a specific pool
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: subscribeToPricePool
    title: Subscribe to price pool
    description: Subscribe to pool price
    type: receive
    messages:
      - &ref_5
        id: joinPricePool
        payload:
          - name: joinPricePool
            description: Subscribe to pool price updates
            type: object
            properties:
              - name: type
                type: string
                description: join
                required: true
              - name: room
                type: string
                description: Price pool room (price:{poolId})
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
          properties:
            type:
              type: string
              const: join
              default: join
              x-parser-schema-id: <anonymous-schema-2>
            room:
              type: string
              pattern: ^price:[A-Za-z0-9]{32,44}$
              description: Price pool room (price:{poolId})
              default: price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
              x-parser-schema-id: <anonymous-schema-3>
          examples:
            - type: join
              room: price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
          x-parser-schema-id: <anonymous-schema-1>
        title: Join price pool
        description: Subscribe to pool price updates
        example: |-
          {
            "type": "join",
            "room": "price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: joinPricePool
          - id: x-parser-message-name
            value: joinPricePool
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: priceByPool
  - &ref_3
    id: receivePricePoolConfirmation
    title: Receive price pool confirmation
    description: Receive confirmation
    type: send
    messages:
      - &ref_7
        id: pricePoolJoined
        payload:
          - name: pricePoolJoined
            description: Pool 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-5>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-6>
          examples:
            - type: joined
              room: price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
          x-parser-schema-id: <anonymous-schema-4>
        title: Price pool joined
        description: Pool price subscription confirmed
        example: |-
          {
            "type": "joined",
            "room": "price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: pricePoolJoined
          - id: x-parser-message-name
            value: pricePoolJoined
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: receivePricePoolData
    title: Receive price pool data
    description: Receive price updates
    type: send
    messages:
      - &ref_8
        id: pricePoolMessage
        payload:
          - name: pricePoolMessage
            description: Pool price update
            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: price
                    type: number
                    required: false
                  - name: price_quote
                    type: number
                    required: false
                  - name: pool
                    type: string
                    required: false
                  - name: token
                    type: string
                    required: false
                  - name: time
                    type: integer
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              const: message
              x-parser-schema-id: <anonymous-schema-8>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-9>
            data:
              type: object
              properties:
                price:
                  type: number
                  x-parser-schema-id: <anonymous-schema-10>
                price_quote:
                  type: number
                  x-parser-schema-id: <anonymous-schema-11>
                pool:
                  type: string
                  x-parser-schema-id: <anonymous-schema-12>
                token:
                  type: string
                  x-parser-schema-id: <anonymous-schema-13>
                time:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-14>
              x-parser-schema-id: PriceUpdate
          examples:
            - type: message
              room: price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
              data:
                price: 0.000008006
                price_quote: 0.0000010064
                pool: EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
                token: EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
                time: 1723728065246
          x-parser-schema-id: <anonymous-schema-7>
        title: Price pool message
        description: Pool price update
        example: |-
          {
            "type": "message",
            "room": "price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump",
            "data": {
              "price": 0.000008006,
              "price_quote": 0.0000010064,
              "pool": "EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump",
              "token": "EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump",
              "time": 1723728065246
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: pricePoolMessage
          - id: x-parser-message-name
            value: pricePoolMessage
    bindings: []
    extensions: *ref_0
  - &ref_2
    id: unsubscribeFromPricePool
    title: Unsubscribe from price pool
    description: Unsubscribe from price
    type: receive
    messages:
      - &ref_6
        id: leavePricePool
        payload:
          - name: leavePricePool
            description: Unsubscribe from pool 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-16>
            room:
              type: string
              default: price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
              x-parser-schema-id: <anonymous-schema-17>
          examples:
            - type: leave
              room: price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump
          x-parser-schema-id: <anonymous-schema-15>
        title: Leave price pool
        description: Unsubscribe from pool price
        example: |-
          {
            "type": "leave",
            "room": "price:EWiYmq3nWQpoTkcU4UfGYEoYvDHduDsXhpPvqmoqpump"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: leavePricePool
          - id: x-parser-message-name
            value: leavePricePool
    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: priceByPool
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: []

````