Adding Token Swaps to Your App with Jupiter: A Practical Overview
How to add token swaps to a Solana app with Jupiter: quotes, routes, slippage, fees, the embeddable widget versus the API, and what to watch for in production.
By Blue Brick team · Published 26 September 2026 · 2 min read
If your app needs users to swap tokens, whether that's buying your token, paying in any currency, or rebalancing a portfolio, you don't need to build an exchange. Jupiter is Solana's main swap aggregator: it searches liquidity across Solana's exchanges and finds the best route for each trade.
This guide explains the options for integrating it and what matters in production.
What an aggregator does
Liquidity on Solana is spread across many exchanges and pool types. For a given swap, the best price might come from one pool, or from splitting the trade across several, or from hopping through an intermediate token. Jupiter works that out for you and returns a route plus a ready-to-sign transaction.
Three ways to integrate
1. Link out
The simplest option: a button that opens Jupiter's own swap page with the right tokens selected. Perfect for a token landing page (see adding a buy button). No code, but users leave your site.
2. The embeddable widget
Jupiter offers an embeddable swap interface you can drop into your site, styled to fit. Users swap without leaving, and you don't handle routing or transactions yourself.
3. The API
For full control, your app calls Jupiter's API:
- Get a quote: send the input token, output token and amount; receive the expected output and route.
- Build the swap transaction from that quote, for the user's wallet.
- Have the user sign it in their wallet, then send it and confirm it.
This lets you design your own interface, combine a swap with your own program's instructions, or swap as part of a bigger flow such as "pay in any token".
Check Jupiter's developer docs for the current API version, limits and any API key requirements before building; they evolve.
Things that matter in production
- Slippage. Prices can move between quote and execution. Set a sensible slippage tolerance, and show users the minimum they'll receive.
- Price impact. Large trades in thin pools move the price. Show the impact and warn when it's high.
- Priority fees. Busy periods need higher fees to land quickly; use dynamic priority fees rather than a fixed guess.
- Fresh quotes. Quotes go stale in seconds. Refresh before the user signs.
- Failure handling. Explain what went wrong ("price moved beyond your slippage") and let users retry easily.
- Token safety. If users can pick any token, warn about unverified tokens and look-alike names.
Earning from swaps
Jupiter's integration options let apps add a platform fee to swaps made through them, a common way for wallets and dApps to earn. If you use it, disclose it clearly to users.
Swaps plus your own logic
The real power comes from combining a swap with your own on-chain logic, for example "swap SOL to USDC, then deposit into our vault" in one transaction, or accepting payment in any token while you always receive USDC. That's where custom DeFi development comes in.
Build it with us
We integrate Jupiter swaps into dApps, payment flows and trading interfaces, and build the custom programs around them. See our DeFi and program development and dApp development services.
Keep reading
DeFi & programs
How a Staking Program Works on Solana: Design and Pitfalls
How token staking works on Solana: vaults and PDAs, reward-per-share maths, lockups, funding rewards and the security pitfalls to avoid.
26 Sept 2026 · 3 min read
Web3 gaming
How to Build a Web3 Game on Solana: Architecture That Works
How to build a Web3 game on Solana: what belongs on-chain, player-owned items, in-game tokens, easy sign-in, session keys and real-time options.
26 Sept 2026 · 3 min read
Web3 gaming
Designing a Web3 Game Economy That Doesn't Collapse
Why so many play-to-earn economies collapsed, and how to design a Web3 game economy that lasts: sources and sinks, two-token models and testing.
26 Sept 2026 · 3 min read