Messages
{
"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"
}Websockets
/stream/swap
同时推送交换报价与预构建交易。订阅交易对后,池状态变更时会收到可签名交易。
WSS
/
stream
/
swap
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.
Messages
{
"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 Swap Updates
type:object
Subscribe to real-time swap quotes with pre-built transactions for a token pair
Unsubscribe from Swap Updates
type:object
Unsubscribe from a specific swap subscription
Ping
type:object
Send a ping to keep the swap stream connection alive
Swap Update
type:object
Real-time swap quote with pre-built transaction, sent whenever pool states change
Swap Subscription Confirmation
type:object
Confirmation that a swap subscription was successfully created
Swap Unsubscription Confirmation
type:object
Confirmation that a swap subscription was removed
Pong Response
type:object
Response to a ping message on swap stream
Swap Error Response
type:object
Error message from the swap stream server
此页面对您有帮助吗?
⌘I