DEX Aggregator (1inch/Jupiter) Integration in Mobile Crypto Wallet
A DEX aggregator finds the best exchange rate by splitting the trade across multiple pools. Integrating 1inch or Jupiter means connecting their API for quotes and either their router contract for execution or getting ready-made calldata and sending it directly.
1inch Fusion API for EVM Networks
1inch Fusion is a mechanism where swaps execute via Resolvers with no gas from the user (gasless swap). User signs an order, resolver pays gas and gets paid.
// iOS — quote request via 1inch Fusion API
let url = URL(string: "https://api.1inch.dev/fusion/quoter/v2.0/1/quote/receive?fromTokenAddress=\(tokenIn)&toTokenAddress=\(tokenOut)&amount=\(amount)")!
var request = URLRequest(url: url)
request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
let (data, _) = try await URLSession.shared.data(for: request)
let quote = try JSONDecoder().decode(FusionQuote.self, from: data)
For classic swap (not Fusion): /v5.2/{chainId}/swap returns a fully ready transaction: to, data, value, gas. The app just signs and sends, no ABI decoding needed.
Supported networks: Ethereum, BNB Chain, Polygon, Arbitrum, Optimism, Base, Avalanche and more.
Jupiter for Solana
Jupiter is the de-facto standard for Solana swaps. Jupiter API v6:
// Android — get quote and transaction via Jupiter
// Quote
val quoteUrl = "https://quote-api.jup.ag/v6/quote?inputMint=$inputMint&outputMint=$outputMint&amount=$amount&slippageBps=50"
val quoteResponse = httpClient.get(quoteUrl)
// Swap transaction
val swapRequest = SwapRequest(quoteResponse, userPublicKey, dynamicComputeUnitLimit = true, prioritizationFeeLamports = "auto")
val swapResponse = httpClient.post("https://quote-api.jup.ag/v6/swap", swapRequest)
val transaction = swapResponse.swapTransaction // base64 encoded versioned transaction
Jupiter returns VersionedTransaction in base64. On Solana with SolanaSwift—decode, sign with user's Keypair, send via sendTransaction.
prioritizationFeeLamports = "auto" lets Jupiter auto-set priority fee for fast block inclusion—always use.
Key Differences Between Aggregators
| 1inch | Jupiter | 0x | |
|---|---|---|---|
| Networks | EVM (10+) | Solana | EVM (8+) |
| Gasless | Yes (Fusion) | No | No |
| API Key | Required | No (up to limit) | Required |
| Quote Accuracy | High | Very high | High |
Error Handling and Degradation
1inch API might return insufficient liquidity for low-liquidity pairs. Show the user and suggest changing the pair or reducing amount. Don't silently fallback to another aggregator—users should know the quote source.
Rate limits: 1inch Dev Portal is 1 RPS free tier. On a busy mobile wallet, get a paid plan or proxy through your own backend.
Timeline: 3–5 days: quote API integration, swap UI with real-time updates, ready calldata from aggregator, signing and sending, liquidity error handling.







