Messages
{
"type": "subscribe",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 1000000000,
"userPublicKey": "YOUR_WALLET_ADDRESS",
"slippageBps": "50"
}{
"type": "unsubscribe",
"id": "sub_1791374181484151"
}{
"type": "ping"
}{
"type": "subscribed",
"id": "sub_1791374181484151"
}{
"type": "swap",
"id": "sub_1791374197008837",
"timestamp": 1791374197023,
"searchMode": "fast",
"quote": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "117037940",
"minAmountOut": "116452750",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "117037940",
"priceImpact": 0,
"percent": 100
}
],
"swapUsdValue": "117.20",
"platformFee": {
"feeBps": 0,
"feeFromInput": false,
"chargeBps": 0
},
"contextSlot": 454215931,
"timeTaken": 0.0056
},
"swapTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEf…",
"lastValidBlockHeight": 432253664,
"contextSlot": 454215931,
"prioritizationFeeLamports": 9600,
"priorityFeeUsed": 9600
}{
"type": "unsubscribed",
"id": "sub_1791374181484151",
"success": true
}{
"type": "pong",
"timestamp": 1791374181491
}{
"type": "error",
"error": "Invalid inputMint"
}Websockets
Swap stream
wss://raptor.solanatracker.io/stream/swap
Live quotes plus a ready-to-sign transaction for userPublicKey. Sign the latest swapTransaction and send it with POST /send-transaction. If nothing changes for 10 slots, the server re-sends a fresh transaction so the latest one does not expire.
WSS
/
stream
/
swap
Messages
{
"type": "subscribe",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 1000000000,
"userPublicKey": "YOUR_WALLET_ADDRESS",
"slippageBps": "50"
}{
"type": "unsubscribe",
"id": "sub_1791374181484151"
}{
"type": "ping"
}{
"type": "subscribed",
"id": "sub_1791374181484151"
}{
"type": "swap",
"id": "sub_1791374197008837",
"timestamp": 1791374197023,
"searchMode": "fast",
"quote": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "117037940",
"minAmountOut": "116452750",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "117037940",
"priceImpact": 0,
"percent": 100
}
],
"swapUsdValue": "117.20",
"platformFee": {
"feeBps": 0,
"feeFromInput": false,
"chargeBps": 0
},
"contextSlot": 454215931,
"timeTaken": 0.0056
},
"swapTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEf…",
"lastValidBlockHeight": 432253664,
"contextSlot": 454215931,
"prioritizationFeeLamports": 9600,
"priorityFeeUsed": 9600
}{
"type": "unsubscribed",
"id": "sub_1791374181484151",
"success": true
}{
"type": "pong",
"timestamp": 1791374181491
}{
"type": "error",
"error": "Invalid inputMint"
}Subscribe
type:object
Start receiving quotes and ready-to-sign transactions for a token pair
Unsubscribe
type:object
Stop a subscription
Ping
type:object
Keep the connection alive. The server answers with pong.
Subscribed
type:object
The subscription is active. Keep the id to match updates and to unsubscribe.
Swap
type:object
New best quote and a fresh unsigned transaction
Unsubscribed
type:object
The subscription has stopped
Pong
type:object
Answer to ping
Error
type:object
A request was rejected, or a subscription could not produce an update. id is set when the error belongs to a subscription.
Was this page helpful?