Raptor DEX Aggregator is now in Public Beta! Try it out for free Documentation.
{
"type": "subscribe",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 1000000000,
"userPublicKey": "YourWa11etPubkeyHere111111111111111111111111",
"slippageBps": "50"
}{
"type": "unsubscribe",
"id": "swap_1767187968856399"
}{
"type": "ping"
}{
"type": "swap",
"id": "swap_1767187968856399",
"timestamp": 1767188116413,
"quote": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "125891340",
"minAmountOut": "125261880",
"slippageBps": 50,
"priceImpact": 0.00000763905067919488,
"feeAmount": "400000",
"swapUsdValue": "125.89",
"contextSlot": 390395145,
"timeTaken": 0.000677147,
"routePlan": [
{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "125891340",
"feeAmount": "400000",
"priceImpact": 0.00000763905067919488,
"percent": 100,
"pool": "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE",
"dex": "Whirlpool",
"programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
]
},
"swapTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEf...",
"lastValidBlockHeight": 250000000,
"priorityFeeUsed": 100000
}{
"type": "subscribed",
"id": "swap_1767187968856399"
}{
"type": "unsubscribed",
"id": "swap_1767187968856399",
"success": true
}{
"type": "pong",
"timestamp": 1767188116413
}{
"type": "error",
"error": "Invalid userPublicKey"
}WebSocket channel for streaming swap quotes with pre-built transactions. Subscribe to a token pair and receive real-time updates with ready-to-sign swap transactions whenever pool states change.
{
"type": "subscribe",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 1000000000,
"userPublicKey": "YourWa11etPubkeyHere111111111111111111111111",
"slippageBps": "50"
}{
"type": "unsubscribe",
"id": "swap_1767187968856399"
}{
"type": "ping"
}{
"type": "swap",
"id": "swap_1767187968856399",
"timestamp": 1767188116413,
"quote": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "125891340",
"minAmountOut": "125261880",
"slippageBps": 50,
"priceImpact": 0.00000763905067919488,
"feeAmount": "400000",
"swapUsdValue": "125.89",
"contextSlot": 390395145,
"timeTaken": 0.000677147,
"routePlan": [
{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "1000000000",
"amountOut": "125891340",
"feeAmount": "400000",
"priceImpact": 0.00000763905067919488,
"percent": 100,
"pool": "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE",
"dex": "Whirlpool",
"programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
]
},
"swapTransaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEf...",
"lastValidBlockHeight": 250000000,
"priorityFeeUsed": 100000
}{
"type": "subscribed",
"id": "swap_1767187968856399"
}{
"type": "unsubscribed",
"id": "swap_1767187968856399",
"success": true
}{
"type": "pong",
"timestamp": 1767188116413
}{
"type": "error",
"error": "Invalid userPublicKey"
}Subscribe to real-time swap quotes with pre-built transactions for a token pair
Unsubscribe from a specific swap subscription
Send a ping to keep the swap stream connection alive
Real-time swap quote with pre-built transaction, sent whenever pool states change
Confirmation that a swap subscription was successfully created
Confirmation that a swap subscription was removed
Response to a ping message on swap stream
Error message from the swap stream server
Was this page helpful?