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

> All liquidity actions involving this token. Room: `liquidity:{mint}`. Append `:enriched` for current wallet identity. Events are provisional at processed commitment; overlapping rooms can deliver the same action more than once.

# Liquidity token

## SDK Example

```typescript theme={null}
import { Datastream } from '@solana-tracker/data-api';

const dataStream = new Datastream({
  wsUrl: 'wss://datastream.solanatracker.io/YOUR_API_KEY',
});

dataStream.on('error', console.error);
await dataStream.connect();

const sub = dataStream.subscribe.liquidity.token('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN', { enriched: true }).on((data) => {
  console.log(data);
});

// sub.unsubscribe();
```


## AsyncAPI

````yaml datastream/liquidity.json liquidityToken
id: liquidityToken
title: Liquidity token
description: >-
  All liquidity actions involving this token. Room: `liquidity:{mint}`. Append
  `:enriched` for current wallet identity. Events are provisional at processed
  commitment; overlapping rooms can deliver the same action more than once.
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_2
    id: subscribeTokenLiquidity
    title: Subscribe token liquidity
    description: Subscribe to token liquidity
    type: receive
    messages:
      - &ref_5
        id: join
        payload:
          - name: Subscribe to token liquidity
            type: object
            properties:
              - name: type
                type: string
                description: join
                required: true
              - name: room
                type: string
                description: liquidity:{mint} (append :enriched for identity)
                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
              default: liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              description: liquidity:{mint} (append :enriched for identity)
              x-parser-schema-id: <anonymous-schema-3>
          examples:
            - type: join
              room: liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-1>
        title: Subscribe to token liquidity
        example: |-
          {
            "type": "join",
            "room": "liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: join
          - id: x-parser-message-name
            value: join
    bindings: []
    extensions: &ref_1
      - id: x-codeSamples
        value: &ref_8
          - lang: typescript
            label: SDK
            source: >
              import { Datastream } from '@solana-tracker/data-api';


              const dataStream = new Datastream({
                wsUrl: 'wss://datastream.solanatracker.io/YOUR_API_KEY',
              });


              dataStream.on('error', console.error);

              await dataStream.connect();


              const sub =
              dataStream.subscribe.liquidity.token('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
              { enriched: true }).on((data) => {
                console.log(data);
              });


              // sub.unsubscribe();
      - id: x-parser-unique-object-id
        value: liquidityToken
  - &ref_4
    id: receiveTokenLiquidity
    title: Receive token liquidity
    description: Token liquidity notification
    type: send
    messages:
      - &ref_7
        id: message
        payload:
          - name: Token liquidity notification
            type: object
            properties:
              - name: type
                type: string
                description: message
                required: true
              - name: room
                type: string
                required: true
              - name: data
                type: array
                required: true
                properties:
                  - name: tx
                    type: string
                    required: true
                  - name: type
                    type: string
                    enumValues:
                      - add_liquidity
                      - remove_liquidity
                    required: true
                  - name: program
                    type: string
                    required: true
                  - name: programId
                    type: string
                    required: true
                  - name: instruction
                    type: string
                    required: true
                  - name: pool
                    type: string
                    required: true
                  - name: wallet
                    type: string
                    required: true
                  - name: time
                    type: integer
                    description: Unix milliseconds
                    required: true
                  - name: slot
                    type: integer
                    required: true
                  - name: amountBasis
                    type: string
                    description: >-
                      Transfer amounts are gross, before Token-2022 withholding.
                      Principal separates CLMM fees and DLMM/Orca rebalancing.
                    enumValues:
                      - transfer
                      - principal
                    required: true
                  - name: tokens
                    type: array
                    required: true
                    properties:
                      - name: address
                        type: string
                        required: true
                      - name: amount
                        type: string
                        description: Exact decimal amount
                        required: true
                      - name: amountRaw
                        type: string
                        required: true
                      - name: decimals
                        type: integer
                        required: true
                      - name: feeAmountRaw
                        type: string
                        required: false
                      - name: transferredAmountRaw
                        type: string
                        required: false
                  - name: identity
                    type: &ref_0
                      - object
                      - 'null'
                    description: >-
                      Only on :enriched rooms. Current wallet identity, or null
                      when unknown.
                    required: false
                  - name: identityStatus
                    type: string
                    description: >-
                      Only present when an enriched lookup was incomplete. No
                      correction is sent for that notification.
                    enumValues:
                      - partial
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
            - data
          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: array
              items:
                type: object
                required:
                  - tx
                  - type
                  - program
                  - programId
                  - instruction
                  - pool
                  - wallet
                  - time
                  - slot
                  - amountBasis
                  - tokens
                properties:
                  tx:
                    type: string
                    x-parser-schema-id: <anonymous-schema-11>
                  type:
                    type: string
                    enum:
                      - add_liquidity
                      - remove_liquidity
                    x-parser-schema-id: <anonymous-schema-12>
                  program:
                    type: string
                    x-parser-schema-id: <anonymous-schema-13>
                  programId:
                    type: string
                    x-parser-schema-id: <anonymous-schema-14>
                  instruction:
                    type: string
                    x-parser-schema-id: <anonymous-schema-15>
                  pool:
                    type: string
                    x-parser-schema-id: <anonymous-schema-16>
                  wallet:
                    type: string
                    x-parser-schema-id: <anonymous-schema-17>
                  time:
                    type: integer
                    description: Unix milliseconds
                    x-parser-schema-id: <anonymous-schema-18>
                  slot:
                    type: integer
                    x-parser-schema-id: <anonymous-schema-19>
                  amountBasis:
                    type: string
                    enum:
                      - transfer
                      - principal
                    description: >-
                      Transfer amounts are gross, before Token-2022 withholding.
                      Principal separates CLMM fees and DLMM/Orca rebalancing.
                    x-parser-schema-id: <anonymous-schema-20>
                  tokens:
                    type: array
                    minItems: 1
                    items:
                      type: object
                      required:
                        - address
                        - amount
                        - amountRaw
                        - decimals
                      properties:
                        address:
                          type: string
                          x-parser-schema-id: <anonymous-schema-23>
                        amount:
                          type: string
                          description: Exact decimal amount
                          x-parser-schema-id: <anonymous-schema-24>
                        amountRaw:
                          type: string
                          pattern: ^[0-9]+$
                          x-parser-schema-id: <anonymous-schema-25>
                        decimals:
                          type: integer
                          minimum: 0
                          maximum: 255
                          x-parser-schema-id: <anonymous-schema-26>
                        feeAmountRaw:
                          type: string
                          x-parser-schema-id: <anonymous-schema-27>
                        transferredAmountRaw:
                          type: string
                          x-parser-schema-id: <anonymous-schema-28>
                      x-parser-schema-id: <anonymous-schema-22>
                    x-parser-schema-id: <anonymous-schema-21>
                  identity:
                    type: *ref_0
                    additionalProperties: true
                    description: >-
                      Only on :enriched rooms. Current wallet identity, or null
                      when unknown.
                    x-parser-schema-id: <anonymous-schema-29>
                  identityStatus:
                    type: string
                    enum:
                      - partial
                    description: >-
                      Only present when an enriched lookup was incomplete. No
                      correction is sent for that notification.
                    x-parser-schema-id: <anonymous-schema-30>
                x-parser-schema-id: LiquidityEvent
              x-parser-schema-id: <anonymous-schema-10>
          examples:
            - type: message
              room: liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              data:
                - tx: >-
                    5V4apVkgHf49J5acYPiuh5rB89EGsF8ocSysgnD9vFfZsTtDamhN3MFDKJSq7Dn7Z6Y5XhjghuVYuvvYWnSFpnvW
                  type: add_liquidity
                  program: pumpfun-amm
                  programId: pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA
                  instruction: deposit
                  pool: 9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2
                  wallet: F7R61te4Ac8xZ4pfkJUdF6iaaHy9tnM8nVRUPv8H8EMi
                  time: 1789722000000
                  slot: 370000000
                  amountBasis: transfer
                  tokens:
                    - address: 6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
                      amount: '123.000001'
                      amountRaw: '123000001'
                      decimals: 6
                    - address: So11111111111111111111111111111111111111112
                      amount: '9.000000001'
                      amountRaw: '9000000001'
                      decimals: 9
          x-parser-schema-id: <anonymous-schema-7>
        title: Token liquidity notification
        example: |-
          {
            "type": "message",
            "room": "liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
            "data": [
              {
                "tx": "5V4apVkgHf49J5acYPiuh5rB89EGsF8ocSysgnD9vFfZsTtDamhN3MFDKJSq7Dn7Z6Y5XhjghuVYuvvYWnSFpnvW",
                "type": "add_liquidity",
                "program": "pumpfun-amm",
                "programId": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA",
                "instruction": "deposit",
                "pool": "9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2",
                "wallet": "F7R61te4Ac8xZ4pfkJUdF6iaaHy9tnM8nVRUPv8H8EMi",
                "time": 1789722000000,
                "slot": 370000000,
                "amountBasis": "transfer",
                "tokens": [
                  {
                    "address": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
                    "amount": "123.000001",
                    "amountRaw": "123000001",
                    "decimals": 6
                  },
                  {
                    "address": "So11111111111111111111111111111111111111112",
                    "amount": "9.000000001",
                    "amountRaw": "9000000001",
                    "decimals": 9
                  }
                ]
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: message
          - id: x-parser-message-name
            value: message
    bindings: []
    extensions: *ref_1
  - &ref_3
    id: unsubscribeTokenLiquidity
    title: Unsubscribe token liquidity
    description: Unsubscribe from token liquidity
    type: receive
    messages:
      - &ref_6
        id: leave
        payload:
          - name: Unsubscribe from token liquidity
            type: object
            properties:
              - name: type
                type: string
                description: leave
                required: true
              - name: room
                type: string
                description: liquidity:{mint} (append :enriched for identity)
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
          properties:
            type:
              type: string
              const: leave
              default: leave
              x-parser-schema-id: <anonymous-schema-5>
            room:
              type: string
              default: liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              description: liquidity:{mint} (append :enriched for identity)
              x-parser-schema-id: <anonymous-schema-6>
          examples:
            - type: leave
              room: liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-4>
        title: Unsubscribe from token liquidity
        example: |-
          {
            "type": "leave",
            "room": "liquidity:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: leave
          - id: x-parser-message-name
            value: leave
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
  - *ref_3
receiveOperations:
  - *ref_4
sendMessages:
  - *ref_5
  - *ref_6
receiveMessages:
  - *ref_7
extensions:
  - id: x-codeSamples
    value: *ref_8
  - id: x-parser-unique-object-id
    value: liquidityToken
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: []

````