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

# Sniper tracking

> Subscribe to sniper balance and percentage changes for a token



## AsyncAPI

````yaml datastream/safety.json sniperTracking
id: sniperTracking
title: Sniper tracking
description: Subscribe to sniper balance and percentage changes 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: subscribeToSniper
    title: Subscribe to sniper
    description: Subscribe to sniper tracking
    type: receive
    messages:
      - &ref_5
        id: joinSniper
        payload:
          - name: joinSniper
            description: Subscribe to sniper wallet activity
            type: object
            properties:
              - name: type
                type: string
                description: join
                required: true
              - name: room
                type: string
                description: Sniper room (sniper:{tokenAddress})
                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: ^sniper:[A-Za-z0-9]{32,44}$
              description: Sniper room (sniper:{tokenAddress})
              default: sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              x-parser-schema-id: <anonymous-schema-3>
          examples:
            - type: join
              room: sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-1>
        title: Join sniper
        description: Subscribe to sniper wallet activity
        example: |-
          {
            "type": "join",
            "room": "sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: joinSniper
          - id: x-parser-message-name
            value: joinSniper
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: sniperTracking
  - &ref_3
    id: receiveSniperConfirmation
    title: Receive sniper confirmation
    description: Receive sniper confirmation
    type: send
    messages:
      - &ref_7
        id: sniperJoined
        payload:
          - name: sniperJoined
            description: Sniper 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: sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-4>
        title: Sniper joined
        description: Sniper subscription confirmed
        example: |-
          {
            "type": "joined",
            "room": "sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: sniperJoined
          - id: x-parser-message-name
            value: sniperJoined
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: receiveSniperData
    title: Receive sniper data
    description: Receive sniper activity
    type: send
    messages:
      - &ref_8
        id: sniperMessage
        payload:
          - name: sniperMessage
            description: Sniper activity 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: wallet
                    type: string
                    required: false
                  - name: amount
                    type: string
                    required: false
                  - name: tokenAmount
                    type: integer
                    required: false
                  - name: percentage
                    type: number
                    required: false
                  - name: previousAmount
                    type: integer
                    required: false
                  - name: previousPercentage
                    type: number
                    required: false
                  - name: totalSniperPercentage
                    type: number
                    required: false
                  - name: totalInsiderPercentage
                    type: number
                    required: false
                  - name: action
                    type: string
                    enumValues:
                      - buy
                      - sell
                    required: false
                  - name: timestamp
                    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:
                wallet:
                  type: string
                  x-parser-schema-id: <anonymous-schema-10>
                amount:
                  type: string
                  x-parser-schema-id: <anonymous-schema-11>
                tokenAmount:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-12>
                percentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-13>
                previousAmount:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-14>
                previousPercentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-15>
                totalSniperPercentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-16>
                totalInsiderPercentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-17>
                action:
                  type: string
                  enum:
                    - buy
                    - sell
                  x-parser-schema-id: <anonymous-schema-18>
                timestamp:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-19>
              x-parser-schema-id: SniperActivity
          examples:
            - type: message
              room: sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              data:
                wallet: WalletAddressHere
                amount: '1000000000'
                tokenAmount: 1000000
                percentage: 0.15
                previousAmount: 500000
                previousPercentage: 0.075
                totalSniperPercentage: 5.25
                totalInsiderPercentage: 12.5
          x-parser-schema-id: <anonymous-schema-7>
        title: Sniper message
        description: Sniper activity notification
        example: |-
          {
            "type": "message",
            "room": "sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
            "data": {
              "wallet": "WalletAddressHere",
              "amount": "1000000000",
              "tokenAmount": 1000000,
              "percentage": 0.15,
              "previousAmount": 500000,
              "previousPercentage": 0.075,
              "totalSniperPercentage": 5.25,
              "totalInsiderPercentage": 12.5
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: sniperMessage
          - id: x-parser-message-name
            value: sniperMessage
    bindings: []
    extensions: *ref_0
  - &ref_2
    id: unsubscribeFromSniper
    title: Unsubscribe from sniper
    description: Unsubscribe from sniper
    type: receive
    messages:
      - &ref_6
        id: leaveSniper
        payload:
          - name: leaveSniper
            description: Unsubscribe from sniper tracking
            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-21>
            room:
              type: string
              default: sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              x-parser-schema-id: <anonymous-schema-22>
          examples:
            - type: leave
              room: sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-20>
        title: Leave sniper
        description: Unsubscribe from sniper tracking
        example: |-
          {
            "type": "leave",
            "room": "sniper:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: leaveSniper
          - id: x-parser-message-name
            value: leaveSniper
    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: sniperTracking
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: []

````