Stream Swaps

This channel provides recent swap transactions specified by the pools. It will tick every time there were updates in the targeted pools.

Subscribe

Parameters:

ParameterTypeDescription

pools

array

Specify which pool(s) to fetch.

includeFailed

boolean

OPTIONAL. Specify if return any failed swap transaction. true or false

Subscribe sample:

wscat --header "Authorization: $AUTH_HEADER" \
-c wss://ny.solana.dex.blxrbdn.com/ws  --execute '{"jsonrpc": "2.0", "id": 1, "method": "subscribe", "params": ["GetSwapsStream", {"pools": ["58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2"], "includeFailed": true}]}' --wait 10000

Event Result Details:

FieldTypeDescription

slot

string

The slot number.

swap

string

See swapbelow for details.

swap

FieldTypeDescription

success

boolean

If the transaction is a successful.

project

string

Which project this pool belong to.

poolAddress

string

Program address of the pool.

inToken

string

Base token symbol of the pool.

inTokenAddress

string

Base token program address of the pool.

outToken

string

Quote token symbol of the pool.

outTokenAddress

string

Quote token program address of the pool.

inAmount

number

Amount of the swap-in token.

outAmount

number

Amount of the swap-out token.

soureceAccount

string

The source account address where the swap-in token coming from.

destinationAccount

string

The destination account address where the swap-out token coming from.

ownerAaccount

string

The owner address of this swap transaction.

signature

string

Signature of the swap transaction.

Sample event:

{
    "method":"subscribe",
    "params":{
        "subscription":"f29bc4fa-1c0a-42e2-b9b0-1684e6fa8b63",
        "result":{
            "slot":"161254657",
            "swap":{
                "success":true,
                "project":"P_RAYDIUM",
                "poolAddress":"58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
                "inToken":"SOL",
                "inTokenAddress":"So11111111111111111111111111111111111111112",
                "outToken":"USDC",
                "outTokenAddress":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "inAmount":"58256161512",
                "outAmountMin":"817440697",
                "sourceAccount":"AeyzRpmQy2TLEEHYfojeYvthLcNkRSkJTFLPzDg63f6",
                "destinationAccount":"B5jZaSWQshYoZAdJxUxAyAU8MkDE1SofbGu4TdVKf4Kn",
                "ownerAccount":"9PxshGxpm7XKUrVFFGfkp2ngP8wFxSuKpzpU3xSpC9TV",
                "signature":"3R4JqcvpgtURkzmZg9D6gsXveAwzS7ybqNWNYyNHEGvDm2a6A6yD9prU9uTd9G4oJkRTA6CCYZJaFq411MMhL2Dv"
            }
        }
    },
    "jsonrpc":"2.0"
}

Last updated