BTB
/

Jupiter Aggregator

DEX Aggregatorwebsite
Solana's main swap aggregator. An agent asks Jupiter's Swap API for a quote and a ready-to-sign transaction (GET https://api.jup.ag/swap/v2/order with taker), signs it with the user's key and either POSTs it to /swap/v2/execute (Jupiter lands it) or, for custom transactions, gets raw instructions from /swap/v2/build and sends them itself. On-chain the swap runs through the Jupiter Aggregator v6 program.

What you can do

swap (recommended)Swap an exact input amount of one Solana token for another at the best price1) GET https://api.jup.ag/swap/v2/order?inputMint=..&outputMint=..&amount=<base units>&taker=<wallet> (optional slippageBps). 2) Check outAmount, priceImpactPct, feeBps and that transaction is non-empty (else read errorMessage). 3) base64-decode transaction to a VersionedTransaction, sign with the taker key (do not alter it). 4) POST https://api.jup.ag/swap/v2/execute {signedTransaction: base64, requestId}. 5) Check status == 'Success' and signature.
quote onlyGet a price quote without a walletGET /swap/v2/order without taker; read outAmount, priceImpactPct, routePlan, router.
custom swap transactionCompose the swap with your own instructions or CPIGET /swap/v2/build?inputMint&outputMint&amount&taker&slippageBps; build a v0 message from computeBudgetInstructions + setupInstructions + swapInstruction + cleanupInstruction + otherInstructions with the returned address lookup tables and a fresh blockhash; sign and send via your RPC (or tx.jup.ag with tipAmount). The swapInstruction targets program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4.
legacy swap (V1)Quote + swap returning a serialized transactionGET https://api.jup.ag/swap/v1/quote?inputMint&outputMint&amount&slippageBps=50, then POST /swap/v1/swap {quoteResponse, userPublicKey, wrapAndUnwrapSol: true, dynamicComputeUnitLimit: true, prioritizationFeeLamports: {priorityLevelWithMaxLamports: {priorityLevel: 'veryHigh', maxLamports: 1000000}}}; deserialize swapTransaction (base64 VersionedTransaction), sign, sendRawTransaction via your RPC and confirm before lastValidBlockHeight.
resolve tokenFind the correct mint for a tickerGET https://api.jup.ag/tokens/v2/search?query=<ticker>; prefer isVerified tokens with high organicScore and liquidity; confirm the mint with the user.
Scam and copycat tokens: anyone can create a token with any name/symbol; always swap by mint address, check isVerified / organicScore / audit flags from the Tokens API, and confirm with the user.
Slippage and price impact: quotes move quickly; set slippageBps deliberately for illiquid tokens (or let RTSE choose on /order), check priceImpactPct and otherAmountThreshold, and get a fresh order right before signing. Transactions expire with the blockhash (~150 slots, about 1 minute).
Routes can go through many third-party DEX programs; a failure or exploit in one pool affects that swap. Jupiter's listing rules decide which markets are routable (new markets get short instant-routing grace periods).
API dependency: keyless access is limited to 0.5 RPS (429 above it, per organisation, 60 s sliding window); production needs an x-api-key. lite-api.jup.ag is being retired and ultra-api.jup.ag replaced by api.jup.ag/swap/v2.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
Jupiter Aggregator v6 programrouter on solanaJUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4
write route(route_plan: Vec<RoutePlanStep>, in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
ExactIn swap along route_plan (each step: swap variant + percent + input/output index). Fails if output < quoted_out_amount reduced by slippage_bps. Built by the Swap API (/swap/v1/swap or /swap/v2/build); do not hand-encode the route plan or the per-DEX remaining accounts.
write shared_accounts_route(id: u8, route_plan: Vec<RoutePlanStep>, in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
Same as route but uses Jupiter's shared program-owned intermediate token accounts (id selects the program authority), so the user needs no intermediate ATAs.
write exact_out_route(route_plan: Vec<RoutePlanStep>, out_amount: u64, quoted_in_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
ExactOut swap: receive exactly out_amount, spending at most quoted_in_amount plus slippage. Only via Swap API V1 /quote?swapMode=ExactOut (V2 /order supports ExactIn only).
write shared_accounts_exact_out_route(id: u8, route_plan: Vec<RoutePlanStep>, out_amount: u64, quoted_in_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
ExactOut variant using shared accounts.
write route_with_token_ledger(route_plan: Vec<RoutePlanStep>, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u8) / shared_accounts_route_with_token_ledger(id: u8, ...)
Swap the amount recorded by a prior set_token_ledger instruction in the same tx (input = balance change), for composing after another instruction whose output amount is unknown in advance.
write route_v2(in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u16, positive_slippage_bps: u16, route_plan: Vec<RoutePlanStepV2>)
Newer route instruction in the on-chain IDL (u16 platform fee, positive-slippage capture). Variants: shared_accounts_route_v2(id, ...), exact_out_route_v2(out_amount, quoted_in_amount, ...), shared_accounts_exact_out_route_v2. Emitted by current API versions; use the API output as-is.
write route_with_attestation(in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u16, positive_slippage_bps: u16, route_plan: Vec<RoutePlanStepV2>, attestation: [u8; 74])
Route variant carrying a 74-byte attestation (also shared_accounts_route_with_attestation). Present in the on-chain IDL; used by Jupiter's own routing (e.g. RFQ fills inside Metis routes). Not meant to be built by hand.
write set_token_ledger() / create_token_ledger()
Record a token account balance in a token ledger account before *_with_token_ledger routes.
write close_wsol_token_account() / create_token_account(bump: u8)
Helper instructions the API adds for wrapping/unwrapping SOL and creating token accounts.
JUP token (SPL mint)token on solanaJUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
write SPL Token transfer / transferChecked (Token program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)
JUP is a classic SPL token with 6 decimals; mint authority and freeze authority are both null (checked on-chain 2026-11-25). Move it with the SPL Token program between associated token accounts.
read Mint account (getAccountInfo / getTokenSupply)
Read supply and decimals (6).