Efficient Token Swaps with Slippage Control
This page provides a guide to performing efficient token swaps on Solana using Jupiter Exchange, complete with slippage control for precise execution.
quote_url = (
f"{JUP_API}/quote?"
f"inputMint={input_mint}"
f"&outputMint={output_mint}"
f"&amount={int(input_amount * LAMPORTS_PER_SOL)}"
f"&slippageBps={slippage_bps}"
f"&onlyDirectRoutes=true"
f"&maxAccounts=20"
)Last updated
