WebSocket API Reference

Real-time streaming API for Solana transactions

Connection Details

  • WebSocket URL: ws://solana-mainnet-api-vip.lyslabs.ai:8080

  • Protocol: WebSocket (WSS for production)

  • Authentication: API Key via query parameter

Message Types

subscription

Confirmation of successful subscription to transaction stream.

{
   "type":"subscription",
   "status":"success"
}
transaction

Individual transaction data with comprehensive details.

{
   "type":"transaction",
   "data":{
      "txSignature":"5xG...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "eventType":"TRANSFER",
      "decoderType":"SPL_TOKEN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourceAccount":"7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
      "sourceOwner":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "destinationAccount":"J6QN6yzGfvGgJVQHfP7VTNf6i2gTgtJfYXMYrKXLmqQs",
      "destinationOwner":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount":"1000000",
      "uiAmount":{
         "value":"1.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
transactions

Batch of multiple transactions for efficiency.

{
   "type":"transactions",
   "data":[
      {
         "txSignature":"5xG...",
         "blockTime":1234567890,
         "blockHeight":123456789,
         "slot":123456789,
         "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
         "eventType":"TRANSFER",
         "decoderType":"SPL_TOKEN",
         "txFee":5000,
         "txFeeUiAmount":{
            "value":"0.000005",
            "type":"PreciseDecimal",
            "isCustomDecoderValue":true
         }
      },
      {
         "txSignature":"3zB...",
         "blockTime":1234567890,
         "blockHeight":123456789,
         "slot":123456789,
         "programId":"11111111111111111111111111111111",
         "eventType":"TRANSFER",
         "decoderType":"SYSTEM_PROGRAM",
         "txFee":5000,
         "txFeeUiAmount":{
            "value":"0.000005",
            "type":"PreciseDecimal",
            "isCustomDecoderValue":true
         }
      }
   ]
}
block

Complete block data including all transactions and metadata.

{
   "type":"block",
   "data":{
      "slot":"123456789",
      "blockhash":"H4ATKcfMvSpGpR1P2HRqvZ5pjS7zLMH5sQPvLhJGzLHb",
      "blockTime":{
         "timestamp":"1234567890"
      },
      "blockHeight":{
         "blockHeight":"123456789"
      },
      "parentSlot":"123456788",
      "parentBlockhash":"5M1iqGGY7gKNkLNMB4oaLJzJf9VLvQs1EM3AqhzFZzEm",
      "executedTransactionCount":"42",
      "transactions":[
         {
            "signature":"5xG...",
            "isVote":false,
            "transaction":{
               "signatures":[
                  "5xG..."
               ],
               "message":{
                  "header":{
                     "numRequiredSignatures":1,
                     "numReadonlySignedAccounts":0,
                     "numReadonlyUnsignedAccounts":3
                  },
                  "accountKeys":[
                     "Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
                     "7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
                     "J6QN6yzGfvGgJVQHfP7VTNf6i2gTgtJfYXMYrKXLmqQs",
                     "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                  ],
                  "recentBlockhash":"H4ATKcfMvSpGpR1P2HRqvZ5pjS7zLMH5sQPvLhJGzLHb",
                  "instructions":[
                     {
                        "programIdIndex":3,
                        "accounts":"010203",
                        "data":"0200000064000000"
                     }
                  ],
                  "versioned":false,
                  "addressTableLookups":[
                     
                  ]
               }
            },
            "meta":{
               "err":null,
               "fee":"5000",
               "preBalances":[
                  "10000000000",
                  "10000000",
                  "5000000"
               ],
               "postBalances":[
                  "9999995000",
                  "9000000",
                  "6000000"
               ],
               "innerInstructions":[
                  
               ],
               "innerInstructionsNone":false,
               "logMessages":[
                  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke",
                  "Program log: Transfer 1 token",
                  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success"
               ],
               "logMessagesNone":false,
               "preTokenBalances":[
                  
               ],
               "postTokenBalances":[
                  
               ],
               "rewards":[
                  
               ],
               "loadedWritableAddresses":[
                  
               ],
               "loadedReadonlyAddresses":[
                  
               ],
               "returnDataNone":true,
               "computeUnitsConsumed":"200000"
            },
            "index":"0"
         }
      ]
   }
}
info

Server information and status messages.

error

Error messages and troubleshooting information.

Detailed Event Examples

Below are examples of decoded events for different transaction types.

SPL Token Events

Token Transfer

A token transfer between two accounts.

Token Mint

Minting new tokens to an account.

Token Burn

Burning tokens from an account.

System Program Events

SOL Transfer

A native SOL transfer between accounts.

Raydium Events

Raydium AMM Swap

A token swap on Raydium AMM.

Raydium CLMM Add Liquidity

Adding liquidity to a Raydium CLMM pool.

Meteora Events

Meteora DLMM Add Position

Adding a position to a Meteora DLMM pool.

Meteora DAMM Swap

A token swap on Meteora DAMM.

Pump Fun Events

Pump Fun Buy

A buy transaction on Pump Fun.

LaunchLab Events

LaunchLab Create Token

Creating a new token on LaunchLab.

Boop Fun Events

Boop Fun Boop

A boop action on Boop Fun.

Last updated