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.
Raptor is Solana Tracker’s DEX aggregator and swap API. A DEX aggregator checks many decentralized exchanges and finds a route for your swap. The flow is: request a quote, build a swap transaction from that quote, sign it client-side, then submit the signed transaction to Raptor’s sender.
HTTP Base URL: https://raptor-beta.solanatracker.io
WebSocket Base URL: wss://raptor-beta.solanatracker.io
Raptor 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.
Use dexes 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:
inputMint
outputMint
amount in smallest units, which means blockchain integer amounts with no decimals
- optional
slippageBps in basis points, where 50 means 0.5%
- optional routing controls like
dexes, pools, and maxHops
curl "https://raptor-beta.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000&slippageBps=50"
Restrict Routes
curl "https://raptor-beta.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000&slippageBps=dynamic&dexes=raydium,meteora,pumpfun&maxHops=2"
2. Build a Swap Transaction
Use Build swap transaction to create a serialized transaction.
Send this request body:
userPublicKey
quoteResponse from /quote
- optional transaction tuning like
priorityFee, txVersion, computeUnitLimit, tipLamports, and platform fee fields
const quote = await fetch(
"https://raptor-beta.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000&slippageBps=50"
).then(r => r.json());
const swap = await fetch("https://raptor-beta.solanatracker.io/swap", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
userPublicKey: "YOUR_WALLET_ADDRESS",
wrapUnwrapSol: true,
txVersion: "v0",
priorityFee: "medium",
maxPriorityFee: 1000000,
quoteResponse: quote
})
}).then(r => r.json());
console.log(`Swap tx: ${swap.swapTransaction}`);
console.log(`Last valid block height: ${swap.lastValidBlockHeight}`);
console.log(`Priority fee: ${swap.prioritizationFeeLamports}`);
Transaction Controls
| Field | Purpose |
|---|
txVersion | legacy or v0 |
priorityFee | priority level like medium, high, veryHigh or exact microlamports |
maxPriorityFee | cap dynamic priority fees |
computeUnitPriceMicroLamports | Priority fee: override compute-unit price directly |
computeUnitLimit | override CU limit |
tipAccount / tipLamports | add optional SOL tip |
feeAccount / feeBps / feeFromInput / chargeBps | platform fee controls |
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.
const result = await fetch("https://raptor-beta.solanatracker.io/quote-and-swap", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
userPublicKey: "YOUR_WALLET_ADDRESS",
inputMint: "So11111111111111111111111111111111111111112",
outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
amount: 100000000,
slippageBps: "dynamic",
txVersion: "v0",
priorityFee: "high",
maxHops: 2,
dexes: "raydium,meteora,whirlpool"
})
}).then(r => r.json());
console.log(result.quote.amountOut);
console.log(result.swapTransaction);
4. Sign Client-Side
Raptor returns swapTransaction as base64. Sign it in the wallet, then send the signed base64 transaction.
import { VersionedTransaction } from "@solana/web3.js";
const txBytes = Uint8Array.from(atob(swap.swapTransaction), c => c.charCodeAt(0));
const tx = VersionedTransaction.deserialize(txBytes);
const signed = await wallet.signTransaction(tx);
const signedBase64 = btoa(String.fromCharCode(...signed.serialize()));
5. Send the Signed Transaction
Send signed transactions with raptor/transactions: POST /send-transaction.
const sendResult = await fetch("https://raptor-beta.solanatracker.io/send-transaction", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ transaction: signedBase64 })
}).then(r => r.json());
console.log(`Signature: ${sendResult.signature}`);
console.log(`Accepted: ${sendResult.success}`);
Raptor sends through Yellowstone Jet TPU and retries in the background until the transaction confirms or expires.
Track Status
const status = await fetch(
`https://raptor-beta.solanatracker.io/transaction/${sendResult.signature}`
).then(r => r.json());
console.log(`Status: ${status.status}`);
console.log(`Latency: ${status.latency_ms}ms`);
console.log(`Slot: ${status.slot}`);
Valid statuses are pending, confirmed, failed, and expired.
6. Build Instructions Only
Use Build swap instructions when you want instructions without a transaction wrapper.
const instructions = await fetch("https://raptor-beta.solanatracker.io/swap-instructions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
userPublicKey: "YOUR_WALLET_ADDRESS",
quoteResponse: quote,
txVersion: "v0"
})
}).then(r => r.json());
console.log(instructions.swapInstruction.programId);
console.log(instructions.addressLookupTableAddresses);
7. Stream Live Quotes
Use the Raptor WebSocket /stream endpoint for quote updates.
const ws = new WebSocket("wss://raptor-beta.solanatracker.io/stream");
ws.onopen = () => {
ws.send(JSON.stringify({
type: "subscribe",
id: "sol-usdc-quote",
inputMint: "So11111111111111111111111111111111111111112",
outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
amount: 100000000,
slippageBps: "50",
maxHops: 2,
dexes: "raydium,meteora,whirlpool"
}));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "subscribed") {
console.log(`Subscribed: ${msg.id}`);
}
if (msg.type === "quote") {
console.log(`Quote update: ${msg.data.amountOut}`);
}
};
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.
const ws = new WebSocket("wss://raptor-beta.solanatracker.io/stream/swap");
ws.onopen = () => {
ws.send(JSON.stringify({
type: "subscribe",
id: "sol-usdc-swap",
inputMint: "So11111111111111111111111111111111111111112",
outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
amount: 100000000,
userPublicKey: "YOUR_WALLET_ADDRESS",
slippageBps: "50",
txVersion: "v0",
priorityFee: "medium",
wrapUnwrapSol: true,
maxHops: 2
}));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "swap") {
console.log(`Updated quote: ${msg.quote.amountOut}`);
console.log(`Swap tx: ${msg.swapTransaction}`);
console.log(`Last valid block height: ${msg.lastValidBlockHeight}`);
}
};
/stream/swap re-sends the latest transaction after 10 slots without an update to help avoid transaction expiry.
End-to-End Flow
- Call
/quote with inputMint, outputMint, amount, and optional routing controls.
- Pass the returned
quoteResponse into /swap with userPublicKey.
- Sign the returned
swapTransaction in the wallet.
- Submit the signed base64 transaction to
/send-transaction.
- Poll
/transaction/{signature} for status.
If you want fewer round-trips, use /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.