Swap Quoting
Single endpoint to quote swaps across EVM, Solana and TON — same shape, chain-specific calldata block. Best-route aggregation, slippage protection, integrated fee accounting.
Documentation Index
Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/2/swap/quoting returns the cheapest route for a token-in → token-out trade plus the calldata to execute it. Same envelope across chains; per-chain extension under data.evm / data.solana / data.ton.
EVM
Solana
TON
Arguments
Required
| Param | Type | Description |
|---|---|---|
chainId | string | evm:<N> (e.g. evm:8453), solana:solana, or ton:mainnet |
tokenIn | string | Sell token address. Native sentinel varies per chain (see below). |
tokenOut | string | Buy token address |
amount or amountRaw | string | Either the human amount ("1.5") or the raw amount ("1500000"). Exactly one. |
walletAddress | string | The user’s address (used as recipient + fee context) |
Common optional
| Param | Type | Default | Description |
|---|---|---|---|
slippage | string % | 1 | 0-100 |
feePercentage | string % | – | Caller referral fee 0-99% (Mobula skims 20% off the top) |
feeWallet | string | – | Required when feePercentage > 0 |
minFeesNative | string | – | Minimum caller referral fee in the chain’s native token. Currently honored on TON native-input swaps. |
excludedProtocols | csv string | – | DEX-level deny list (e.g. pump-amm,raydium) |
onlyProtocols | csv string | – | DEX-level allow list |
onlyRouters | csv string | – | Aggregator filter — jupiter, kyberswap, lifi, naos |
poolAddress | string | – | Pin routing to a single pool |
Solana-only
| Param | Description |
|---|---|
priorityFee | auto / low / medium / high / veryHigh / microLamports number |
computeUnitLimit | true (dynamic) or fixed CU (default 400 000) |
jitoTipLamports | Adds a Jito tip transfer for fast landing |
multiLander | true returns N candidates over a durable nonce |
landerTipLamports | Per-lander tip when multiLander=true |
payerAddress | Fee abstraction — separate fee payer from walletAddress |
Native sentinel addresses
| Chain | Sentinel |
|---|---|
| EVM | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
| Solana | So11111111111111111111111111111111111111112 |
| TON | EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c |
Response
evm / solana / ton is populated, the others are null. See the per-chain pages above for the calldata shape.
Common fields (every chain)
| Field | Type | Description |
|---|---|---|
amountOutTokens | string | Estimated output, human-readable |
amountInUSD / amountOutUSD | number | USD value at quote time |
slippagePercentage | number | Echo of the input parameter |
marketImpactPercentage | number | Estimated price impact at this trade size |
poolFeesPercentage | number | Sum of LP fees paid across the route |
tokenIn / tokenOut | object | {address, symbol?, name?, decimals, logo?} |
requestId | string | Unique per quote — pass to support / analytics |
details.route.hops[] | array | One entry per pool used (multi-hop) |
details.route.aggregator | string | Which aggregator picked the route |
fee | object? | Echoed when feePercentage was set: {amount, percentage, wallet, deductedFrom: 'input'|'output'} |
Chain-specific calldata
Thedata.evm, data.solana, data.ton blocks carry the chain-specific transaction shape:
| Chain | Block | Shape |
|---|---|---|
| EVM | data.evm.transaction | { to, from, data, value, gasLimit?, chainId, approvalAddress?, approvals[]? } — see EVM Quoting |
| Solana | data.solana.transaction + lastValidBlockHeight | { serialized: base64, variant: 'versioned' | 'legacy' } — see Solana Quoting |
| TON | data.ton.transactions[1..4] + data.ton.fees | { to, value, body, bounce, stateInit? }[] — see TON Quoting |
multiLander=true (Solana only), data.candidates[] replaces data.solana.transaction — see the Solana page.
Quick example
/swap/send endpoint, or — for EVM — directly from your wallet.
Errors
200 with data: null, error: "<message>" for routing failures (no route, slippage too tight, …). 4xx for validation, 5xx for upstream RPC issues. The requestId field always survives — include it when reporting issues.Query Parameters
Mobula chain id. EVM: evm:<integer> (e.g. evm:1, evm:8453, evm:42161). Solana: solana:solana. TON: ton:mainnet or ton:testnet.
Sell token address. Native sentinels — EVM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (EIP-7528). Solana: So11111111111111111111111111111111111111112 (wSOL). TON: EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c.
1Buy token address. Same sentinel rules as tokenIn.
1Human-readable amount (e.g. "1.5" for 1.5 tokens). Converted server-side: raw = amount × 10^decimals. Mutually exclusive with amountRaw.
Raw amount as a digit-only string (e.g. "1500000" for 1.5 USDC at 6 decimals). Use this when you already have the bigint to avoid float precision loss. Mutually exclusive with amount.
Slippage tolerance in % (0-100, default 1). Quote rejects if expected output drops below this threshold.
User wallet address — recipient of tokenOut, signer for the broadcast tx, fee context.
1DEX-level deny list (CSV). Example: pump-amm,raydium.
DEX-level allow list (CSV). Example: uniswap-v3,uniswap-v4.
Pin routing to a single pool (e.g. when you want a specific Uniswap V3 fee tier).
Aggregator filter (CSV) — jupiter, kyberswap, lifi, naos. Omit to let the API pick.
Solana only. auto, low, medium, high, veryHigh, or microLamports per CU as a number string.
Solana only. true for dynamic CU limit, or a fixed integer (default 400 000).
Solana only. Jito tip in lamports — adds a transfer to one of the Jito tip accounts for fast landing.
Caller referral fee in % (0-99). Mobula skims a 20% platform cut off the top. Requires feeWallet.
Wallet that receives the caller referral fee. Required when feePercentage > 0.
Minimum caller referral fee in native-token units. Currently honored on TON native-input swaps; requires feeWallet.
Solana only. Fee abstraction — wallet that signs/pays for the tx (separate from walletAddress).
Solana only. true returns N candidate transactions over a durable nonce — race them across landers (Jito, Nozomi, 0slot). Only one commits.
Per-lander tip when multiLander=true. Defaults to each lander's minimum.