BTB Finance for agents

Protocols / DEX Aggregator

Jupiter Aggregator

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.

On-chain + APISOLANA2 contractsWebsite · Docs

get_protocol({ "protocol": "jupiter-aggregator" })

Risks an agent should know

What an agent can do

swap (recommended)Swap an exact input amount of one Solana token for another at the best price
1) 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 wallet
GET /swap/v2/order without taker; read outAmount, priceImpactPct, routePlan, router.
custom swap transactionCompose the swap with your own instructions or CPI
GET /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 transaction
GET 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 ticker
GET https://api.jup.ag/tokens/v2/search?query=<ticker>; prefer isVerified tokens with high organicScore and liquidity; confirm the mint with the user.

Contracts

solana

ContractAddressKey functionsTry
Jupiter Aggregator v6 program
router
JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4
source
writeroute(route_plan: Vec<RoutePlanStep>, in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
writeshared_accounts_route(id: u8, route_plan: Vec<RoutePlanStep>, in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
writeexact_out_route(route_plan: Vec<RoutePlanStep>, out_amount: u64, quoted_in_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
writeshared_accounts_exact_out_route(id: u8, route_plan: Vec<RoutePlanStep>, out_amount: u64, quoted_in_amount: u64, slippage_bps: u16, platform_fee_bps: u8)
writeroute_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, ...)
writeroute_v2(in_amount: u64, quoted_out_amount: u64, slippage_bps: u16, platform_fee_bps: u16, positive_slippage_bps: u16, route_plan: Vec<RoutePlanStepV2>)
writeroute_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])
writeset_token_ledger() / create_token_ledger()
+1 more via get_protocol
JUP token (SPL mint)
token
JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
source
writeSPL Token transfer / transferChecked (Token program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)
readMint account (getAccountInfo / getTokenSupply)

APIs

Swap API V2: GET /order (Meta-Aggregator quote + transaction)
auth: none
https://api.jup.ag/swap/v2/order
Recommended path. Query: inputMint, outputMint, amount (input base units, e.g. lamports; ExactIn only), taker (wallet that signs; omit for a quote only, then transaction is null). Optional: slippageBps (0-10000; omit to let Jupiter's RTSE choose), receiver (different wallet to receive output), referralAccount + referralFee (50-255 bps), payer (integrator pays gas; disables Dflow/OKX), priorityFeeLamports, jitoTipLamports, broadcastFeeType (maxCap|exactFee), excludeRouters (metis,jupiterz,dflow,okx), excludeDexes (Metis only), maxSupportedTransactionVersion ('0'|'1'). Response: transaction (base64 unsigned versioned tx), requestId, inAmount, outAmount, otherAmountThreshold, slippageBps, priceImpactPct, routePlan, router, feeBps, feeMint, gasless, errorCode/errorMessage. Keyless works at 0.5 RPS; send x-api-key for higher limits. SOL is wrapped/unwrapped automatically; use mint So11111111111111111111111111111111111111112 for SOL.
Swap API V2: POST /execute (managed landing)
auth: none
https://api.jup.ag/swap/v2/execute
Body JSON {signedTransaction: base64 of the /order transaction after the taker signs it, requestId: from /order, lastValidBlockHeight?}. Jupiter lands the tx (priority fee set for you, polls confirmation). Response: status (Success|Failed), signature, code, totalInputAmount, totalOutputAmount, inputAmountResult, outputAmountResult, error. Separate rate-limit bucket (keyless 20 RPS, free 50, paid 100). Do not modify the /order transaction before signing (JupiterZ RFQ transactions cannot be modified).
Swap API V2: GET /build (Router path, raw instructions)
auth: none
https://api.jup.ag/swap/v2/build
For custom transactions / CPI. Query: inputMint, outputMint, amount, taker (all required); slippageBps (default 50, or 'rtse'), mode=fast, dexes / excludeDexes, platformFeeBps + feeAccount, maxAccounts (default 64), maxBytes, payer, wrapAndUnwrapSol (default true), destinationTokenAccount / nativeDestinationAccount, blockhashSlotsToExpiry (default 150), tipAmount (for tx.jup.ag), computeUnitPricePercentile (medium|high|veryHigh|0-10000), forJitoBundle, transactionVersion ('0'|'1'). Returns quote plus computeBudgetInstructions, setupInstructions, swapInstruction, cleanupInstruction, otherInstructions, tipInstruction and addressesByLookupTableAddress; you assemble a v0 tx, sign, and send via your own RPC or tx.jup.ag. Metis routing only, no Jupiter swap fee.
Swap API V1 (Metis): GET /quote, POST /swap, POST /swap-instructions
auth: none
https://api.jup.ag/swap/v1
Older two-step flow, still documented and live but superseded by V2. GET /quote?inputMint&outputMint&amount&slippageBps (default 50)&swapMode (ExactIn|ExactOut)&dexes&excludeDexes&restrictIntermediateTokens&onlyDirectRoutes&maxAccounts&platformFeeBps -> quoteResponse. POST /swap {quoteResponse, userPublicKey, wrapAndUnwrapSol (default true), dynamicComputeUnitLimit, prioritizationFeeLamports ({priorityLevelWithMaxLamports:{priorityLevel:'veryHigh',maxLamports:N}} or {jitoTipLamports:N}), feeAccount, destinationTokenAccount, payer} -> {swapTransaction (base64 versioned tx), lastValidBlockHeight, prioritizationFeeLamports}; deserialize, sign, send via your RPC. POST /swap-instructions takes the same body and returns the instructions separately. Use V1 only if you need ExactOut.
Program ID to Label
auth: none
https://api.jup.ag/swap/v2/program-id-to-label
Map of DEX program ids to labels (for dexes/excludeDexes and for identifying the failing program in a swap error).
Transaction submission (tx.jup.ag)
auth: api-key
https://tx.jup.ag
Send-only Solana RPC-compatible endpoint (sendTransaction) that lands any signed transaction through Jupiter's landing infrastructure; requires x-api-key and a SOL tip (min 0.001 SOL; /build tipAmount adds it). Not needed for /order + /execute.
Tokens API V2
auth: none
https://api.jup.ag/tokens/v2/search
GET ?query=<symbol|name|mint> resolves a ticker to mints with isVerified, organicScore, audit flags (mint/freeze authority, isSus), decimals, tokenProgram, liquidity. Use it to pick the right mint and screen out fakes before swapping.
Price API V3
auth: none
https://api.jup.ag/price/v3
GET ?ids=<comma-separated mints, max 50> -> usdPrice, decimals, priceChange24h, liquidity. Tokens without a reliable price are omitted.
API keys and plans (Developer Platform)
auth: api-key
https://developers.jup.ag/portal
Create an API key (format jup_...) and pass it as the x-api-key header on api.jup.ag. Tiers: Keyless 0.5 RPS (no sign-up), Free 1 RPS, Developer $25/mo 10 RPS, Launch $100/mo 50 RPS, Pro $500/mo 150 RPS; limits per organisation, 60 s sliding window. The old free host lite-api.jup.ag is being phased out in favour of keyless api.jup.ag; ultra-api.jup.ag (Ultra) moved to api.jup.ag/swap/v2 with identical /order and /execute.

Notes

DefiLlama slug 'jupiter-aggregator' (parent 'jupiter'; siblings include Jupiter Perpetual Exchange, Jupiter Lend, Jupiter DCA/Limit, Jupiter Staked SOL, JupUSD). Program id JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 is named as 'the Jupiter v6 swap aggregator program' on Jupiter's dev docs (RFQ v2 streaming page) and declared in jup-ag/jupiter-cpi (src/lib.rs); confirmed executable on mainnet (BPF upgradeable). Instruction names and args come from the program's on-chain Anchor IDL (fetched 2026-11-25); the older IDL in jup-ag/jupiter-cpi lacks the v2/attestation variants. Related Jupiter products (not separate contracts here): Jupiter Lend program ids from developers.jup.ag/docs/lend/architecture: Liquidity jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC, Lending/Earn jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9, Vaults/Borrow jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi (plus Earn Rewards jup7TthsMgcR9Y3L277b8Eo9uboVSmu1utkuXHNUKar and Borrow Oracle jupnw4B6Eqs7ft6rxpzYLJZYSnrpRgPcr589n5Kv4oc per developers.jup.ag/docs/jupusd/juiced); Lend Earn API at api.jup.ag/lend/v1/earn/*. Jupiter Perps: the dev docs (developers.jup.ag/docs/perps/*) say the Perps API is a work in progress and only link to the Perpetuals program on Solscan (PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu, executable on mainnet) and the single JLP Pool account 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq without a plain statement of the id, so Perps is not listed as a contract. JLP mint left out: no official Jupiter page found that states the JLP mint address (only third-party sites). The Ultra Swap API is not a separate product any more: Jupiter's docs say Ultra users move to /swap/v2/order + /execute with identical parameters. Other Jupiter APIs (Trigger limit orders/DCA, Recurring, Prediction, Studio, Lock) are documented at developers.jup.ag/docs; Jupiter also runs a hosted Trading MCP at https://mcp.jup.ag.

Sources

Researched 2026-11-25. Addresses are copied from the official sources above; check them before moving large amounts.