Documentation Index
Fetch the complete documentation index at: https://docs.raydium.io/llms.txt
Use this file to discover all available pages before exploring further.
What is the Transaction API?
The Raydium Transaction API (Route V2) is a server-side service that builds serialized Solana swap transactions without requiring clients to maintain an RPC connection or bundle the entire Raydium SDK. This dramatically simplifies integration for:- Web frontends that cannot run a local RPC client
- Mobile applications with limited resources
- Headless trading bots
- Aggregators and wallet providers
Workflow Overview
The Transaction API separates concerns into two phases:1. Compute Phase: Get a Quote
Call/compute/swap-base-in or /compute/swap-base-out to receive the expected swap output (or required input) based on current pool states. This endpoint is read-only and does not require any signing:
- Expected output amount
- Route breakdown (which pools and liquidity sources are used)
- Price impact
2. Transaction Phase: Build and Sign
Once you have the compute response, pass it (along with wallet and configuration) to/transaction/swap-base-in or /transaction/swap-base-out:
- A base64-encoded versioned transaction ready to sign
- Address lookup table addresses (if txVersion=V0)
- Decodes the transaction
- Signs it with the user’s keypair
- Broadcasts it via any Solana RPC
- Awaits confirmation
Compute Endpoints
GET /compute/swap-base-in
Use case: User specifies input amount, we compute the output.
Required query parameters:
inputMint– Mint address of the token you’re sendingoutputMint– Mint address of the token you wantamount– Input amount in lamports (smallest unit)slippageBps– Maximum acceptable slippage in basis points (0–10000)txVersion–V0orLEGACY
referrerBps– If you have a referrer authority, basis points of the output to collect as referrer fee
GET /compute/swap-base-out
Use case: User specifies desired output, we compute the required input.
Required query parameters:
inputMint,outputMint,amount(desired output),slippageBps,txVersion
Transaction Endpoints
POST /transaction/swap-base-in
Builds a transaction for a fixed input amount.
Required body:
wallet– Your signing wallet addressswapResponse– The entire compute response objecttxVersion– Transaction versioncomputeUnitPriceMicroLamports– Priority fee in micro-lamports
wrapSol– If true, wrap native SOL for inputunwrapSol– If true, unwrap WSOL to SOL in outputinputAccount– Token account for input (required if not wrapping SOL)outputAccount– Token account for outputnonceInfo– Durable nonce for offline signingjitoInfo– Jito MEV protection bundle paramsreferrerWallet– Referrer wallet for fee collection
POST /transaction/swap-base-out
Builds a transaction for a fixed output amount.
Same parameters as base-in, except:
referrerInfofield is currently commented out (not yet implemented)
Response Envelope
All endpoints return a standard envelope:success is false and msg contains the error code (e.g., REQ_WALLET_ERROR, REQ_SLIPPAGE_BPS_ERROR).
Transaction Response Shape
A successful transaction response looks like:Integration Example
Here’s a typical flow in pseudocode:Key Parameters Explained
txVersion
- V0: Modern Solana transaction with Address Lookup Tables (ALTs). Smaller serialization size, lower fees.
- LEGACY: Pre-ALT transaction format. Larger, but works with all RPC endpoints.
computeUnitPriceMicroLamports
Priority fee for faster block inclusion. Set to 0 for no priority fee, or higher values (e.g., 1000) to compete in congested networks. Units are micro-lamports per compute unit.
slippageBps
Maximum slippage tolerance in basis points. 100 = 1%, 50 = 0.5%.
- Use lower values (e.g., 25–50 bps) for most stable swaps
- Increase for volatile or low-liquidity pairs
wrapSol and unwrapSol
- wrapSol: If
true, the API wraps your native SOL into WSOL. NoinputAccountneeded. - unwrapSol: If
true, the API unwraps the output WSOL back to native SOL. NooutputAccountneeded.
false, you must provide explicit token accounts.
Network Endpoints
| Network | Mainnet | Devnet |
|---|---|---|
| Host | transaction-v1.raydium.io | transaction-v1-devnet.raydium.io |
| Protocol | HTTPS | HTTPS |
Error Codes
Common error messages:| Code | Meaning |
|---|---|
REQ_SLIPPAGE_BPS_ERROR | Slippage is invalid or out of range |
REQ_INPUT_MINT_ERROR | Input mint address is invalid |
REQ_OUTPUT_MINT_ERROR | Output mint address is invalid |
REQ_AMOUNT_ERROR | Amount is not a valid number |
REQ_TX_VERSION_ERROR | txVersion must be V0 or LEGACY |
REQ_WALLET_ERROR | Wallet address is invalid |
REQ_INPUT_ACCOUT_ERROR | Input token account missing or invalid |
REQ_OUTPUT_ACCOUT_ERROR | Output token account missing or invalid |
UNKNOWN_ERROR | Server-side error; check your request parameters |


