curl --request GET \
--url https://demo-api.mobula.io/api/2/swap/quotingimport requests
url = "https://demo-api.mobula.io/api/2/swap/quoting"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/swap/quoting', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.mobula.io/api/2/swap/quoting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api.mobula.io/api/2/swap/quoting"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/swap/quoting")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/swap/quoting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"requestId": "<string>",
"solana": {
"transaction": {
"serialized": "AQABAuObQ8Adqk1eqZxRMJg4r6vGtXq9k0...base64...",
"variant": "versioned"
},
"lastValidBlockHeight": 269450123
},
"amountOutTokens": "245.123",
"slippagePercentage": 1,
"amountInUSD": 200.45,
"amountOutUSD": 199.87,
"marketImpactPercentage": 0.04,
"poolFeesPercentage": 0.25,
"tokenIn": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"tokenOut": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"details": {
"route": {
"hops": [
{
"poolAddress": "<string>",
"tokenIn": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"tokenOut": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"amountInTokens": "1.0",
"amountOutTokens": "245.1",
"index": 0,
"amountInRaw": "<string>",
"amountOutRaw": "<string>",
"poolAmountOutRaw": "<string>",
"theoreticalAmountOutRaw": "<string>",
"theoreticalAmountOutTokens": "<string>",
"amountOutBeforeTokenFeesRaw": "<string>",
"amountOutBeforeTokenFeesTokens": "<string>",
"exchange": "Raydium",
"poolType": "CLMM",
"feePercentage": 0.25,
"feeBps": 25,
"feeSource": "<string>",
"marketImpactPercentage": 0.08,
"priceImpactPercentage": 123,
"liquidityUSD": 123,
"volume24hUSD": 123,
"price": 123,
"reserve0Raw": "<string>",
"reserve1Raw": "<string>",
"ranking": {
"marketImpactPercentage": 123,
"feePercentage": 123,
"feeBps": 123,
"liquidityUSD": 123,
"volume24hUSD": 123,
"amountInRaw": "<string>",
"amountOutRaw": "<string>",
"theoreticalAmountOutRaw": "<string>"
}
}
],
"totalFeePercentage": 0.25,
"totalFeeBps": 25,
"hopCount": 2,
"marketImpactPercentage": 0.12,
"aggregator": "jupiter",
"ranking": {
"marketImpactPercentage": 123,
"totalFeePercentage": 123,
"totalFeeBps": 123,
"hopCount": 123,
"amountInRaw": "<string>",
"amountOutRaw": "<string>"
}
},
"aggregator": "<string>",
"raw": {}
},
"fee": {
"amount": "0.001",
"percentage": 0.5,
"wallet": "0xCALLER…",
"deductedFrom": "input"
},
"fees": [
{
"amount": "0.001",
"percentage": 0.5,
"wallet": "0xCALLER…",
"deductedFrom": "input"
}
],
"evm": null,
"ton": null
},
"error": "<string>"
}{
"message": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"requestId": "<string>"
}{
"message": "<string>",
"requestId": "<string>"
}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.
curl --request GET \
--url https://demo-api.mobula.io/api/2/swap/quotingimport requests
url = "https://demo-api.mobula.io/api/2/swap/quoting"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/swap/quoting', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.mobula.io/api/2/swap/quoting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api.mobula.io/api/2/swap/quoting"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/swap/quoting")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/swap/quoting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"requestId": "<string>",
"solana": {
"transaction": {
"serialized": "AQABAuObQ8Adqk1eqZxRMJg4r6vGtXq9k0...base64...",
"variant": "versioned"
},
"lastValidBlockHeight": 269450123
},
"amountOutTokens": "245.123",
"slippagePercentage": 1,
"amountInUSD": 200.45,
"amountOutUSD": 199.87,
"marketImpactPercentage": 0.04,
"poolFeesPercentage": 0.25,
"tokenIn": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"tokenOut": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"details": {
"route": {
"hops": [
{
"poolAddress": "<string>",
"tokenIn": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"tokenOut": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://metadata.mobula.io/assets/logos/evm_8453_0x8335…"
},
"amountInTokens": "1.0",
"amountOutTokens": "245.1",
"index": 0,
"amountInRaw": "<string>",
"amountOutRaw": "<string>",
"poolAmountOutRaw": "<string>",
"theoreticalAmountOutRaw": "<string>",
"theoreticalAmountOutTokens": "<string>",
"amountOutBeforeTokenFeesRaw": "<string>",
"amountOutBeforeTokenFeesTokens": "<string>",
"exchange": "Raydium",
"poolType": "CLMM",
"feePercentage": 0.25,
"feeBps": 25,
"feeSource": "<string>",
"marketImpactPercentage": 0.08,
"priceImpactPercentage": 123,
"liquidityUSD": 123,
"volume24hUSD": 123,
"price": 123,
"reserve0Raw": "<string>",
"reserve1Raw": "<string>",
"ranking": {
"marketImpactPercentage": 123,
"feePercentage": 123,
"feeBps": 123,
"liquidityUSD": 123,
"volume24hUSD": 123,
"amountInRaw": "<string>",
"amountOutRaw": "<string>",
"theoreticalAmountOutRaw": "<string>"
}
}
],
"totalFeePercentage": 0.25,
"totalFeeBps": 25,
"hopCount": 2,
"marketImpactPercentage": 0.12,
"aggregator": "jupiter",
"ranking": {
"marketImpactPercentage": 123,
"totalFeePercentage": 123,
"totalFeeBps": 123,
"hopCount": 123,
"amountInRaw": "<string>",
"amountOutRaw": "<string>"
}
},
"aggregator": "<string>",
"raw": {}
},
"fee": {
"amount": "0.001",
"percentage": 0.5,
"wallet": "0xCALLER…",
"deductedFrom": "input"
},
"fees": [
{
"amount": "0.001",
"percentage": 0.5,
"wallet": "0xCALLER…",
"deductedFrom": "input"
}
],
"evm": null,
"ton": null
},
"error": "<string>"
}{
"message": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"requestId": "<string>"
}{
"message": "<string>",
"requestId": "<string>"
}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 | Taker address: supplies tokenIn, signs, pays gas, and receives tokenOut unless recipientAddress is set |
Common optional
| Param | Type | Default | Description |
|---|---|---|---|
slippage | string | auto | % value (0-100) or auto |
feePercentages | csv / array % | – | Caller referral fees, parallel to feeWallets — entry i is paid to wallet i (max 4, EVM). Mobula skims 20% off each entry. Chains without multi-recipient support (Solana/TON) use the first entry. |
feeWallets | csv / array | – | Wallets receiving the caller referral fees, parallel to feePercentages |
feePercentage | string % | – | Deprecated — use feePercentages/feeWallets (still accepted; plural wins when both are sent). Caller referral fee 0-99% (Mobula skims 20% off the top) |
feeWallet | string | – | Deprecated — required when feePercentage > 0 |
minFeesNative | string | – | Minimum caller referral fee in the chain’s native token. Honored on TON native-input swaps and on Solana when the fee asset is native SOL (enforced on-chain by MobulaRouter). |
feeToken | string | – | Solana only. Mint of a token to charge a flat minimum fee in (with minFeesTokenRaw), via a dedicated transfer to feeWallet, independent of the route. |
minFeesTokenRaw | string | – | Solana only. Raw amount (smallest unit) of feeToken to charge. Tx reverts if balance is insufficient. |
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 |
EVM-only
| Param | Type | Default | Description |
|---|---|---|---|
recipientAddress | string | walletAddress | Address that receives tokenOut; walletAddress remains the taker and signer. See EVM Quoting. |
sellEntireBalance | boolean string | false | Set to true to sell the wallet’s complete ERC-20 tokenIn balance at execution. amount / amountRaw remains required as the routing and minimum-output estimate. See EVM Quoting. |
Solana-only
| Param | Description |
|---|---|
prioritizationFeeLamports | Jupiter-compatible priority fee budget: auto, fixed lamports, or {"priorityLevelWithMaxLamports":{"priorityLevel":"medium" | "high" | "veryHigh","maxLamports":1000000,"global":false}} |
dynamicComputeUnitLimit | Solana only. true by default; dynamically sizes the compute limit from the built swap instructions |
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. The payer signs and pays Solana fees / ATA rent; swap funds still come from walletAddress. |
closeAuthority | Close authority for non-WSOL ATAs Mobula creates during the swap when payerAddress is used. Usually set it to the central payer wallet to reclaim rent later. |
destinationWallet | Optional Solana tokenOut recipient. Do not combine with finalRecipientWallet. |
swapRecipientAddress | Router-enforced final output recipient. MobulaRouter transfers the exact final swap output to this wallet after swap execution and fee/slippage checks. Legacy alias: finalRecipientWallet. |
Native sentinel addresses
| Chain | Sentinel |
|---|---|
| EVM | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
| Solana native SOL | So11111111111111111111111111111111111111111 |
| Solana WSOL SPL mint | So11111111111111111111111111111111111111112 |
| TON | EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c |
Response
{
"data": {
"amountOutTokens": "245.123",
"amountInUSD": 200.45,
"amountOutUSD": 199.87,
"slippagePercentage": 1,
"prioritizationFeeLamports": 9999,
"computeUnitLimit": 388876,
"prioritizationType": {
"computeBudget": {
"microLamports": 25715,
"estimatedMicroLamports": 785154
}
},
"marketImpactPercentage": 0.04,
"poolFeesPercentage": 0.25,
"tokenIn": { "address": "…", "symbol": "…", "decimals": 9, "logo": "…" },
"tokenOut": { "address": "…", "symbol": "…", "decimals": 6, "logo": "…" },
"requestId": "f8b2…",
"details": {
"route": {
"hops": [
{ "poolAddress": "…", "tokenIn": { /* … */ }, "tokenOut": { /* … */ }, "amountInTokens": "1.0", "amountOutTokens": "245.1", "exchange": "Raydium", "poolType": "CLMM", "feeBps": 25 }
],
"totalFeePercentage": 0.25,
"aggregator": "jupiter"
}
},
"fee": { "amount": "0.001", "percentage": 0.5, "wallet": "…", "deductedFrom": "input" },
"evm": null,
"solana": { /* … */ },
"ton": null
}
}
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? | Aggregate fee echo: {amount, percentage, wallet, deductedFrom: 'input'|'output'} — total amount/percentage and the first wallet when multiple recipients are set |
fees | array? | Per-recipient fee breakdown when multiple feeWallets are set (each entry has the same shape as fee) |
Which asset carries the fee? On EVM the fee is charged in the quote asset of the pair — native/wrapped native or a listed stablecoin (USDC/USDT/DAI + chain variants on Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche): deducted from the input on buys (quote in), from the output on sells (quote out). A pair with no quote side pays no fee. On Solana the fee asset is native SOL; on TON, native TON.
Solana priority fee fields
Solana quotes expose the applied priority fee at the root ofdata on both /api/2/swap/quoting and /api/2/swap/quoting-instructions. The shape matches Jupiter’s compute-budget response model.
| Field | Type | Description |
|---|---|---|
prioritizationFeeLamports | number | Maximum priority fee at the returned compute limit: ceil(computeUnitLimit * microLamports / 1,000,000). |
computeUnitLimit | number | Value encoded by the transaction’s SetComputeUnitLimit instruction. |
prioritizationType.computeBudget.microLamports | number | Applied CU price encoded by SetComputeUnitPrice, in micro-lamports per CU. |
prioritizationType.computeBudget.estimatedMicroLamports | number | Uncapped CU price estimate. It can exceed microLamports when a maxLamports budget caps the applied price. |
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
const r = await fetch(
`https://api.mobula.io/api/2/swap/quoting?` + new URLSearchParams({
chainId: 'evm:8453',
tokenIn: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
tokenOut: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
amount: '0.1',
walletAddress: '0xUSER…',
slippage: '1',
}),
{ headers: { Authorization: 'Bearer YOUR_API_KEY' } },
);
const quote = await r.json();
/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
Sell token address. Native identifiers — EVM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (EIP-7528). Solana native SOL: So11111111111111111111111111111111111111111. Use wrapped SOL / WSOL mint So11111111111111111111111111111111111111112 only when swapping WSOL token-account balance. TON: EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c.
1Solana only. Optional wallet that receives the exact final output after the Mobula on-chain router executes the swap and fee/slippage checks. For SPL outputs, Mobula creates the recipient ATA idempotently and closes router-created temporary output accounts when empty. Cannot be combined with destinationWallet.