HTTP Base URL:
WebSocket Base URL:
Raptor is currently in public beta.
https://raptor-beta.solanatracker.ioWebSocket Base URL:
wss://raptor-beta.solanatracker.ioRaptor is currently in public beta.
Supported Routing
Raptor routes across venues and pool types including Raydium, Meteora, Orca Whirlpool, Pump.fun, Pumpswap, MoonIt, Boopfun, FluxBeam, PancakeSwap V3, and more. Usedexes when you want to restrict routing to a subset of supported venues.
1. Get a Quote
Use Get swap quote to fetch the best route. Raptor expects:inputMintoutputMintamountin smallest units, which means blockchain integer amounts with no decimals- optional
slippageBpsin basis points, where50means 0.5% - optional routing controls like
dexes,pools, andmaxHops
Restrict Routes
2. Build a Swap Transaction
Use Build swap transaction to create a serialized transaction. Send this request body:userPublicKeyquoteResponsefrom/quote- optional transaction tuning like
priorityFee,txVersion,computeUnitLimit,tipLamports, and platform fee fields
Transaction Controls
Token accounts and SOL wrapping
The/swap response is a ready-to-sign transaction that already includes everything needed for the swap to land on-chain:
- Associated Token Accounts (ATAs) — Raptor adds
createAssociatedTokenAccountIdempotentinstructions tosetupInstructionsfor any input, output, or intermediate mint where the user does not already have an ATA. You do not need to pre-create ATAs for the output token; the rent (~0.00203 SOL per account) is paid byuserPublicKey. If you build your own transaction from/swap-instructions, keep thesetupInstructionsandcleanupInstructionarrays — that is where ATA creation and SOL wrap/unwrap live. - SOL wrapping —
wrapUnwrapSoldefaults totrue. Raptor wraps SOL into wSOL insetupInstructionswhen SOL is the input, and unwraps any remaining wSOL back to native SOL incleanupInstructionwhen SOL is the output. SetwrapUnwrapSol: falseonly if you are managing a long-lived wSOL account yourself.
3. Quote and Build in One Request
Use Quote and swap in one request if you want a single request instead of separate/quote and /swap calls.
4. Sign Client-Side
Raptor returnsswapTransaction as base64. Sign it in the wallet, then send the signed base64 transaction.
5. Send the Signed Transaction
Send signed transactions with raptor/transactions:POST /send-transaction.
Track Status
pending, confirmed, failed, and expired.
6. Build Instructions Only
Use Build swap instructions when you want instructions without a transaction wrapper.Atomic Buy → Sell in One Transaction (Token Ledger)
When you want to buy a token on one pool and sell it on another in the same transaction — for example, a two-hop arbitrage — you do not know the exact amount the sell leg will receive until the buy leg executes on-chain. ThetokenLedgerInstruction returned by /swap-instructions solves this: it records the actual output of the buy leg at runtime, so the sell leg consumes whatever the buy produced.
The flow is:
- Call
/swap-instructionsfor the buy leg (e.g. SOL → TOKEN on pool 1). Use the returnedtokenLedgerInstructionto capture the on-chain output amount. - Call
/swap-instructionsfor the sell leg (e.g. TOKEN → SOL on pool 2). The sell instruction reads its input amount from the token ledger written by the buy leg. - Assemble both calls’
computeBudgetInstructions,setupInstructions,tokenLedgerInstruction,swapInstruction, andcleanupInstructioninto a singleVersionedTransaction. Deduplicate setup/cleanup instructions and combine theaddressLookupTableAddressesfrom both responses. - Sign once and submit through
/send-transaction.
tokenLedgerInstructionisnullfor ordinary single-swap responses — that is expected. It is populated when the swap is part of a chain where a later instruction needs to read the runtime output of an earlier one.amountOutin a quote is the expected output and cannot be set toauto. The token ledger is the supported way to chain “sell whatever the buy produced” without knowing the amount ahead of time.- Keep both legs inside the compute unit budget. You may need to raise
computeUnitLimitandcomputeUnitPriceMicroLamportswhen combining two swaps.
7. Stream Live Quotes
Use the Raptor WebSocket/stream endpoint for quote updates.
8. Stream Ready-to-Sign Swap Transactions
Use/stream/swap when you want live quote updates plus a fresh prebuilt transaction.
This stream requires userPublicKey because Raptor builds the transaction for that wallet.
/stream/swap re-sends the latest transaction after 10 slots without an update to help avoid transaction expiry.
End-to-End Flow
- Call
/quotewithinputMint,outputMint,amount, and optional routing controls. - Pass the returned
quoteResponseinto/swapwithuserPublicKey. - Sign the returned
swapTransactionin the wallet. - Submit the signed base64 transaction to
/send-transaction. - Poll
/transaction/{signature}for status.
/quote-and-swap instead of separate /quote and /swap calls.
Raptor Overview
Full endpoint reference, supported DEXs, routing controls, and WebSocket details.
Raptor Transactions
Send signed transactions and track confirmation status through Raptor.