Hosted API
Free. Call
raptor.solanatracker.io with nothing to install or run. Start with the quickstart below.Self-hosted binary
Free. Download Raptor from GitHub and run the same API on your own servers, with no limits.
JIT routing
A normal route picks its pools when you quote. With just-in-time (JIT) routing, the transaction carries several candidate pools and picks the best ones when it executes, using live prices. This helps most on larger orders and fast-moving pools.
Quotes that use JIT include
"jitRouting": true. Things to know:
minAmountOutis still enforced. If live prices can’t meet it, the transaction fails instead of filling worse.- JIT works with
V0andV1transactions.LEGACYtransactions have no lookup tables and a 1,232-byte limit, so JIT routes rarely fit; quote withjitRouting=falsewhen you needLEGACY. - JIT swaps can’t be called from another program.
/swap-instructionsreturns an ordinary swap unless you sendjitRouting: true. When it returnstopLevelOnly: true, putswapInstructionlast in the transaction and call it directly, not through CPI. Otherwise it fails withInvalidJitPlan(6026). - JIT is available on every supported DEX except Heaven, SolFi V1, BisonFi and Quantum.
Quickstart
Every swap takes the same five steps. Raptor does the routing; the user’s wallet only signs.1
Get a quote
Ask for the price of selling 0.1 SOL (
100000000 lamports) for USDC. No wallet is needed.amountOut is the expected USDC (6 decimals). minAmountOut is the least the swap will accept.2
Build the transaction
Send the quote back unchanged with the user’s wallet address. Do this right away, because quotes expire after a few seconds.The response holds
swapTransaction, an unsigned base64 transaction.3
Sign and send
Sign
swapTransaction with the wallet, then submit the signed transaction as base64. Raptor keeps resending it until it lands or expires.4
Check the result
Poll until
status is confirmed, failed or expired.Complete example
This script swaps 0.1 SOL for USDC from a local keypair. In a browser app, replace the signing step with your wallet adapter’ssignTransaction.
Endpoints
On a self-hosted instance, streaming,
/send-transaction, /transaction/{signature} and /quote-and-swap are off until you turn them on.
Parameters you’ll use most
Amounts
Amounts are integers in the token’s smallest unit:amount = tokens × 10^decimals. SOL has 9 decimals, so 1000000000 is 1 SOL. USDC has 6, so 1000000 is 1 USDC. Use mint So11111111111111111111111111111111111111112 for SOL; Raptor wraps and unwraps it for you.
Slippage
slippageBps sets the most the price may move against you, in basis points: 50 is 0.5%. Pass dynamic to let Raptor pick a value for the token and route. If the price moves further, the transaction fails instead of filling at a worse price. Only the network fee is spent.
Priority fee
SetpriorityFee on /swap to a level (min, low, medium, auto, high, veryHigh, turbo, unsafeMax) or to a total fee in lamports as a string, such as "50000". The default is auto. maxPriorityFee caps the compute unit price in micro-lamports. The response field prioritizationFeeLamports shows what was included.
Platform fees
Charge your own fee on swaps by addingfeeAccount (a normal wallet address) and feeBps (up to 1000, or 10%) to /quote. The fee carries through to /swap. It’s taken from the output token unless you set feeFromInput=true. minAmountOut already accounts for your fee. chargeBps takes an extra cut only when the user gets more than quoted.
Tips
Add a SOL tip to the transaction, for example to a Jito tip account, withtipAccount and tipLamports on /swap.
Limit the route
On/quote, dexes limits routing to the DEXes you list (comma-separated, case-insensitive). raydium matches every Raydium pool type, and raydium-clmm matches just one. pools limits routing to specific pool addresses, maxHops caps the route length (1 to 4), and onlyDirectRoutes=true allows single-hop routes only.
/quote only. /swap builds whatever route the quote holds.
Search depth
searchMode=deep on /quote searches more pools and routes before it answers. It takes longer, and it never returns less than the default fast search. Use it when the best price matters more than speed, for example on large orders.
Transaction options
These go on/swap, /swap-instructions and /quote-and-swap.
/quote doesn’t need a wallet and doesn’t check balances. You can pass userPublicKey to quote for the wallet that will swap, but /swap still needs it.
Arbitrage
Quote with the same mint as input and output, for example SOL to SOL, and Raptor looks for a cycle through several pools that returns more than you put in.- If
routePlanisn’t empty, Raptor found a cycle.amountOutminusamountis the expected profit, before network and priority fees. Build and send it like any other swap. - If no cycle is profitable, the response has an empty
routePlanandamountOutequal toamount. There’s nothing to build.
--enable-arbitrage.
Token-2022 transfer fees
If the input or output token charges a Token-2022 transfer fee, the quote includestokenTransfers. netOutput is what actually reaches the wallet after platform and transfer fees.
WebSocket
Stream live quotes instead of polling. Each update arrives when the best route changes./streamsends quotes. Use it to show prices./stream/swapsends quotes plus a fresh, ready-to-sign transaction foruserPublicKey. Sign the latest one and send it withPOST /send-transaction.
{ "type": "unsubscribe", "id": "<id from subscribed>" }. One connection holds up to 50 subscriptions. All messages and fields are listed in the WebSocket reference in the sidebar.
Errors
Most errors are JSON,
{ "error": "...", "code": 400 }. Errors from parsing the request (some 400s and 422s) are plain text, so read the body as text before parsing it.
Supported DEXs
Raptor routes across 71 DEXes.Hosted or self-hosted
Both run the same routing engine and build transactions for the same program. See Self-hosting to install the binary.
Next steps
Swap guide
Browser wallets, instructions-only builds and streaming swaps.
Send transactions
Submit signed transactions and read swap results.
Self-hosting
Download the binary from GitHub and run Raptor on your own servers.