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

# Insider tracking

> Subscribe to insider balance and percentage changes for a token



## AsyncAPI

````yaml datastream/safety.json insiderTracking
id: insiderTracking
title: Insider tracking
description: Subscribe to insider 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: subscribeToInsider
    title: Subscribe to insider
    description: Subscribe to insider tracking
    type: receive
    messages:
      - &ref_5
        id: joinInsider
        payload:
          - name: joinInsider
            description: Subscribe to insider wallet activity
            type: object
            properties:
              - name: type
                type: string
                description: join
                required: true
              - name: room
                type: string
                description: Insider room (insider:{tokenAddress})
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - room
          properties:
            type:
              type: string
              const: join
              default: join
              x-parser-schema-id: <anonymous-schema-24>
            room:
              type: string
              pattern: ^insider:[A-Za-z0-9]{32,44}$
              description: Insider room (insider:{tokenAddress})
              default: insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              x-parser-schema-id: <anonymous-schema-25>
          examples:
            - type: join
              room: insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-23>
        title: Join insider
        description: Subscribe to insider wallet activity
        example: |-
          {
            "type": "join",
            "room": "insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: joinInsider
          - id: x-parser-message-name
            value: joinInsider
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: insiderTracking
  - &ref_3
    id: receiveInsiderConfirmation
    title: Receive insider confirmation
    description: Receive insider confirmation
    type: send
    messages:
      - &ref_7
        id: insiderJoined
        payload:
          - name: insiderJoined
            description: Insider 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-27>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-28>
          examples:
            - type: joined
              room: insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-26>
        title: Insider joined
        description: Insider subscription confirmed
        example: |-
          {
            "type": "joined",
            "room": "insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: insiderJoined
          - id: x-parser-message-name
            value: insiderJoined
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: receiveInsiderData
    title: Receive insider data
    description: Receive insider activity
    type: send
    messages:
      - &ref_8
        id: insiderMessage
        payload:
          - name: insiderMessage
            description: Insider 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-30>
            room:
              type: string
              x-parser-schema-id: <anonymous-schema-31>
            data:
              type: object
              properties:
                wallet:
                  type: string
                  x-parser-schema-id: <anonymous-schema-32>
                amount:
                  type: string
                  x-parser-schema-id: <anonymous-schema-33>
                tokenAmount:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-34>
                percentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-35>
                previousAmount:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-36>
                previousPercentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-37>
                totalSniperPercentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-38>
                totalInsiderPercentage:
                  type: number
                  x-parser-schema-id: <anonymous-schema-39>
                action:
                  type: string
                  enum:
                    - buy
                    - sell
                  x-parser-schema-id: <anonymous-schema-40>
                timestamp:
                  type: integer
                  x-parser-schema-id: <anonymous-schema-41>
              x-parser-schema-id: InsiderActivity
          examples:
            - type: message
              room: insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              data:
                wallet: WalletAddressHere
                amount: '5000000000'
                tokenAmount: 5000000
                percentage: 0.75
                previousAmount: 4000000
                previousPercentage: 0.6
                totalSniperPercentage: 5.25
                totalInsiderPercentage: 12.5
          x-parser-schema-id: <anonymous-schema-29>
        title: Insider message
        description: Insider activity notification
        example: |-
          {
            "type": "message",
            "room": "insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
            "data": {
              "wallet": "WalletAddressHere",
              "amount": "5000000000",
              "tokenAmount": 5000000,
              "percentage": 0.75,
              "previousAmount": 4000000,
              "previousPercentage": 0.6,
              "totalSniperPercentage": 5.25,
              "totalInsiderPercentage": 12.5
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: insiderMessage
          - id: x-parser-message-name
            value: insiderMessage
    bindings: []
    extensions: *ref_0
  - &ref_2
    id: unsubscribeFromInsider
    title: Unsubscribe from insider
    description: Unsubscribe from insider
    type: receive
    messages:
      - &ref_6
        id: leaveInsider
        payload:
          - name: leaveInsider
            description: Unsubscribe from insider 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-43>
            room:
              type: string
              default: insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
              x-parser-schema-id: <anonymous-schema-44>
          examples:
            - type: leave
              room: insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
          x-parser-schema-id: <anonymous-schema-42>
        title: Leave insider
        description: Unsubscribe from insider tracking
        example: |-
          {
            "type": "leave",
            "room": "insider:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: leaveInsider
          - id: x-parser-message-name
            value: leaveInsider
    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: insiderTracking
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: []

````