> ## 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: Free Solana Swap API Across 71 DEXes

> Swap any Solana token through a free hosted API or a free self-hosted binary. Get a quote, sign the transaction, and send it. No API key needed.

Out of beta
Raptor V1 is live on mainnet, with JIT routing across 71 DEXes.
[What's new →](https://docs.solanatracker.io/raptor/recent-changes.md)

Raptor finds the best route for a swap across 71 Solana DEXes and gives you a transaction that the user's wallet signs. There are two ways to use it, and **both are currently free**, with no API key or sign-up:

> [card] [Hosted API](#quickstart)
>
> **Free.** Call `raptor.solanatracker.io` with nothing to install or run. Start with the quickstart below.

> [card] [Self-hosted binary](https://docs.solanatracker.io/raptor/self-hosting.md)
>
> **Free.** Download Raptor from GitHub and run the same API on your own servers, with no limits.

Questions go to [Discord](https://discord.gg/JH2e9rR9fc).

| | Address |
| - | - |
| HTTP | `https://raptor.solanatracker.io` |
| WebSocket | `wss://raptor.solanatracker.io` |
| Program ID | `RaptorD5ojtsqDDtJeRsunPLg6GvLYNnwKJWxYE4m87` |

## 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.

Standard routeLocked at quote

You receive

−

Landed

The pools are fixed when you quote. If prices move before the transaction lands, you get less.

Raptor JITPriced at execution

You receive

*

The transaction carries candidate pools. Raptor re-prices them on-chain as it lands and splits the order across the best.

Illustration with example numbers. Real results depend on the order and on how prices move.

| `jitRouting` | Behavior |
| - | - |
| `auto` (default) | Raptor uses JIT when it improves the result. Orders of about \$10,000 or more get a full search. |
| `true` | Always build a JIT route |
| `false` | Never use JIT |

Quotes that use JIT include `"jitRouting": true`. Things to know:

* **`minAmountOut` is still enforced.** If live prices can't meet it, the transaction fails instead of filling worse.
* **JIT works with `V0` and `V1` transactions.** `LEGACY` transactions have no lookup tables and a 1,232-byte limit, so JIT routes rarely fit; quote with `jitRouting=false` when you need `LEGACY`.
* **JIT swaps can't be called from another program.** `/swap-instructions` returns an ordinary swap unless you send `jitRouting: true`. When it returns `topLevelOnly: true`, put `swapInstruction` last in the transaction and call it directly, not through CPI. Otherwise it fails with `InvalidJitPlan` (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.

<ol />

**1. Get a quote**

Ask for the price of selling 0.1 SOL (`100000000` lamports) for USDC. No wallet is needed.

```bash theme={null}
curl "https://raptor.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000&slippageBps=50"
```

`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.

```bash theme={null}
curl -s "https://raptor.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000" \
  | jq '{userPublicKey: "YOUR_WALLET_ADDRESS", quoteResponse: .}' \
  | curl -s -X POST "https://raptor.solanatracker.io/swap" -H "Content-Type: application/json" -d @-
```

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.

```bash theme={null}
curl -X POST "https://raptor.solanatracker.io/send-transaction" \
  -H "Content-Type: application/json" \
  -d '{"transaction": "SIGNED_TRANSACTION_BASE64"}'
```

**4. Check the result**

Poll until `status` is `confirmed`, `failed` or `expired`.

```bash theme={null}
curl "https://raptor.solanatracker.io/transaction/SIGNATURE"
```

### 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's `signTransaction`.

```javascript Node.js theme={null}
// npm install @solana/web3.js bs58
import { Keypair, VersionedTransaction } from "@solana/web3.js";
import bs58 from "bs58";

const RAPTOR = "https://raptor.solanatracker.io";
const SOL = "So11111111111111111111111111111111111111112";
const USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";

const wallet = Keypair.fromSecretKey(bs58.decode(process.env.PRIVATE_KEY));

async function api(path, body) {
  const res = await fetch(`${RAPTOR}${path}`, body && {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(body),
  });
  const text = await res.text();
  if (!res.ok) throw new Error(`${path} ${res.status}: ${text}`);
  return JSON.parse(text);
}

// 1. Quote 0.1 SOL -> USDC
const quote = await api(`/quote?inputMint=${SOL}&outputMint=${USDC}&amount=100000000&slippageBps=50`);
console.log(`Expected: ${quote.amountOut} (min ${quote.minAmountOut})`);

// 2. Build the transaction (right away: quotes expire after a few seconds)
const { swapTransaction } = await api("/swap", {
  userPublicKey: wallet.publicKey.toBase58(),
  quoteResponse: quote,
  priorityFee: "high",
});

// 3. Sign
const tx = VersionedTransaction.deserialize(Buffer.from(swapTransaction, "base64"));
tx.sign([wallet]);

// 4. Send
const { signature } = await api("/send-transaction", {
  transaction: Buffer.from(tx.serialize()).toString("base64"),
});
console.log(`Sent: ${signature}`);

// 5. Wait for the result
for (let i = 0; i < 30; i++) {
  const { status, error } = await api(`/transaction/${signature}`);
  if (status !== "pending") {
    console.log(status, error ?? "");
    break;
  }
  await new Promise((r) => setTimeout(r, 1000));
}
```

```python Python theme={null}
# pip install requests solders
import base64, os, time
import requests
from solders.keypair import Keypair
from solders.transaction import VersionedTransaction

RAPTOR = "https://raptor.solanatracker.io"
SOL = "So11111111111111111111111111111111111111112"
USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

wallet = Keypair.from_base58_string(os.environ["PRIVATE_KEY"])

def api(path, body=None):
    if body is None:
        res = requests.get(RAPTOR + path)
    else:
        res = requests.post(RAPTOR + path, json=body)
    if not res.ok:
        raise RuntimeError(f"{path} {res.status_code}: {res.text}")
    return res.json()

# 1. Quote 0.1 SOL -> USDC
quote = api(f"/quote?inputMint={SOL}&outputMint={USDC}&amount=100000000&slippageBps=50")
print("Expected:", quote["amountOut"], "min", quote["minAmountOut"])

# 2. Build the transaction (right away: quotes expire after a few seconds)
swap = api("/swap", {
    "userPublicKey": str(wallet.pubkey()),
    "quoteResponse": quote,
    "priorityFee": "high",
})

# 3. Sign
unsigned = VersionedTransaction.from_bytes(base64.b64decode(swap["swapTransaction"]))
signed = VersionedTransaction(unsigned.message, [wallet])

# 4. Send
sent = api("/send-transaction", {"transaction": base64.b64encode(bytes(signed)).decode()})
signature = sent["signature"]
print("Sent:", signature)

# 5. Wait for the result
for _ in range(30):
    status = api(f"/transaction/{signature}")
    if status["status"] != "pending":
        print(status["status"], status.get("error", ""))
        break
    time.sleep(1)
```

## Endpoints

| Endpoint | Use it to |
| - | - |
| [`GET /quote`](https://docs.solanatracker.io/raptor/http/get-swap-quote) | Price a swap |
| [`POST /swap`](https://docs.solanatracker.io/raptor/http/build-swap-transaction) | Turn a quote into a transaction to sign |
| [`POST /swap-instructions`](https://docs.solanatracker.io/raptor/http/build-swap-instructions) | Get the instructions to build your own transaction |
| [`POST /quote-and-swap`](https://docs.solanatracker.io/raptor/http/quote-and-swap-in-one-request) | Quote and build in one call |
| [`POST /send-transaction`](https://docs.solanatracker.io/raptor/http/send-a-signed-transaction) | Send a signed transaction |
| [`GET /transaction/{signature}`](https://docs.solanatracker.io/raptor/http/get-transaction-status) | Check whether it landed |
| [`GET /health`](https://docs.solanatracker.io/raptor/http/health-check) | Check the service is up |
| `wss://…/stream` | Stream live quotes ([WebSocket](#websocket)) |
| `wss://…/stream/swap` | Stream live quotes with ready-to-sign transactions |

On a [self-hosted](https://docs.solanatracker.io/raptor/self-hosting.md) instance, streaming, `/send-transaction`, `/transaction/{signature}` and `/quote-and-swap` are off until you [turn them on](https://docs.solanatracker.io/raptor/self-hosting.md#optional-features).

## 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

Set `priorityFee` 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 adding `feeAccount` (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, with `tipAccount` 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.

```bash theme={null}
curl "https://raptor.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=100000000&dexes=raydium,meteora,whirlpool&maxHops=2"
```

Routing options go on `/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`.

| Field | What it does |
| - | - |
| `txVersion` | `V0` (default), `LEGACY` or `V1`. Case-sensitive. JIT works with `V0` and `V1`; for `LEGACY`, quote with `jitRouting=false`. |
| `wrapUnwrapSol` | `true` (default) wraps and unwraps SOL for you. Set `false` to trade from and to the wallet's wrapped SOL account. Use the same value on `/quote`. |
| `destinationTokenAccount` | Deliver the output to this token account instead of the wallet's associated token account. `/quote-and-swap` only. |
| `computeUnitLimit` | Set the compute unit limit instead of Raptor's estimate |
| `computeUnitPriceMicroLamports` | Set an exact compute unit price instead of a `priorityFee` level |

`/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.

In1.000000 SOL

After HumidiFi182.4120 USDC

After Orca0.848100 JitoSOL

Out1.001240 SOL

+0.001240 SOL

Illustration with example numbers. Profit is before network and priority fees.

```bash theme={null}
curl "https://raptor.solanatracker.io/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=So11111111111111111111111111111111111111112&amount=1000000000"
```

* If `routePlan` isn't empty, Raptor found a cycle. `amountOut` minus `amount` is 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 `routePlan` and `amountOut` equal to `amount`. There's nothing to build.

On a self-hosted instance, start the binary with [`--enable-arbitrage`](https://docs.solanatracker.io/raptor/self-hosting#arbitrage).

## Token-2022 transfer fees

If the input or output token charges a Token-2022 transfer fee, the quote includes `tokenTransfers`. `netOutput` is what actually reaches the wallet after platform and transfer fees.

```json theme={null}
{ "tokenTransfers": { "depositFee": "37", "deliveryFee": "31", "netOutput": "9969" } }
```

## WebSocket

Stream live quotes instead of polling. Each update arrives when the best route changes.

* **`/stream`** sends quotes. Use it to show prices.
* **`/stream/swap`** sends quotes plus a fresh, ready-to-sign transaction for `userPublicKey`. Sign the latest one and send it with `POST /send-transaction`.

```javascript theme={null}
const ws = new WebSocket("wss://raptor.solanatracker.io/stream");

ws.onopen = () => ws.send(JSON.stringify({
  type: "subscribe",
  inputMint: "So11111111111111111111111111111111111111112",
  outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  amount: 100000000,
  slippageBps: "50",
}));

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type === "quote") console.log(msg.data.amountOut);
  if (msg.type === "error") console.error(msg.error);
};
```

Stop with `{ "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

| Status | Meaning | What to do |
| - | - | - |
| `400` | A parameter is missing or invalid, such as `amount=0` | Fix the request. The `error` field says which parameter. |
| `404` | `/transaction/{signature}`: not sent through Raptor, or no longer tracked | Check the signature on an RPC node instead. |
| `422` | No route for this pair and amount, or the JSON body is invalid, or the quote expired or was edited | No route: try another amount or fewer filters. Otherwise get a new quote and pass it to `/swap` unchanged, and check that `txVersion` is upper-case. |
| `500` | The transaction couldn't be built | For `Execution plan expired`, get a new quote and retry. |

Most errors are JSON, `{ "error": "...", "code": 400 }`. Errors from parsing the request (some `400`s and `422`s) are plain text, so read the body as text before parsing it.

## Supported DEXs

Raptor routes across 71 DEXes.

| Group | DEXes |
| - | - |
| Raydium | AMM, CLMM, CPMM, LaunchLab |
| Meteora | DLMM, Dynamic AMM, DAMM V2, Curve, Dynamic Bonding Curve |
| Orca | Whirlpool, Whirlpool V2 |
| Launchpads | Pump.fun, Pumpswap, Heaven, MoonIt, Boopfun |
| PropAMMs | HumidiFi, Tessera, SolFi V1, SolFi V2, AlphaQ, ZeroFi, BisonFi, GoonFi V2 |
| Other | FluxBeam, PancakeSwap V3 |
| Added in V1 | Aquifer, Archer, BinaryFi, BisonFi Predict, BonkSwap, Crema, Cropper, Denali, Deriverse, Flint, Fusion, GatorSwap, Hadron, Helium, Huma, Hylo Earn, Hylo Exchange, Invariant, JupLend, JupLend Earn, Kipseli, Kipseli V3, M Swap, Mercurial, MetaDAO, Omnipair, OneDex, Perena, Perena Star, Quantum, Quay, Riptide, Sanctum Infinity, Sanctum PAMM, Sanctum SOLs, Sanctum Stake, Scale AMM, Scorch, Solayer, Stabble CLMM, Stableswap, TaurusFi, Trends, VaultLiquid, Voltr, WhaleStreet V2, xORCA |

## Hosted or self-hosted

| | Hosted API | Self-hosted binary |
| - | - | - |
| Price | Currently free | Currently free |
| Setup | None | Download from [GitHub](https://github.com/solanatracker/raptor-binary/releases/latest), add your RPC and Yellowstone gRPC endpoints |
| API key | None | None |
| Limits | Shared service | None. Run as many instances as you want. |
| Endpoints | All | All. Streaming, sending and `/quote-and-swap` are opt-in flags. |
| Instance-wide DEX, mint and pool allowlists | No | Yes |

Both run the same routing engine and build transactions for the same program. See [Self-hosting](https://docs.solanatracker.io/raptor/self-hosting.md) to install the binary.

The older Solana Tracker [Swap API](https://docs.solanatracker.io/swap-api/swap.md) at `swap-v2.solanatracker.io` is a separate product. It is still live and charges a platform fee on each swap.

## Next steps

> [card] [Swap guide](https://docs.solanatracker.io/guides/swap-api.md)
>
> Browser wallets, instructions-only builds and streaming swaps.

> [card] [Send transactions](https://docs.solanatracker.io/raptor/transactions.md)
>
> Submit signed transactions and read swap results.

> [card] [Self-hosting](https://docs.solanatracker.io/raptor/self-hosting.md)
>
> Download the binary from GitHub and run Raptor on your own servers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.