Skip to main content

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.

Single endpoint, same shape as Solana / TON. The EVM-specific calldata sits under data.evm. See the Swap Quoting page for the full input parameters.

Native sentinel

0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
Standard EIP-7528 placeholder — use this tokenIn / tokenOut for the chain’s native token (ETH on Ethereum/L2s, BNB on BNB Chain, MATIC on Polygon, AVAX on Avalanche, …). The router wraps/unwraps automatically.

Supported chains

ChainchainIdNative
Ethereumevm:1ETH
Optimismevm:10ETH
BNB Chainevm:56BNB
Polygonevm:137POL
Baseevm:8453ETH
Arbitrumevm:42161ETH
Avalancheevm:43114AVAX
Linea, zkSync, Scroll, Mantle, Blast, Mode, Manta, Taiko, Sei, Cronos, Fantom, Gnosis, Celo, Moonbeam, Kava, Metis, opBNB, Polygon zkEVM, Merlin, BOB, Cyber, Fuse, IoTeX, Conflux, Astar zkEVM, ZKFair, XLayer, ZetaChain, Klaytnevm:Nvaries
Full list of integer chain IDs: see MOBULA_CHAIN_MAP in the chains package.

Request

GET /api/2/swap/quoting?chainId=evm:8453
  &tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
  &tokenOut=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  &amount=0.1
  &walletAddress=0x…
  &slippage=1
  &feePercentage=0.5
  &feeWallet=0x…
ParamRequiredNotes
chainIdevm:<integer> (e.g. evm:8453 for Base)
tokenIn / tokenOutToken contract address (lowercased OR checksummed). Native = 0xEee…
amount or amountRawHuman ("0.1") or raw wei ("100000000000000000")
walletAddressUser’s EVM address (0x…)
slippage% (0-100, default 1)
feePercentageCaller referral fee 0-99%
feeWalletRequired when feePercentage > 0
onlyRoutersComma-list of kyberswap,lifi,naos
excludedProtocols / onlyProtocolsDEX-level filter

Response — data.evm

{
  "data": {
    "amountOutTokens": "245.123",
    "amountInUSD": 250.45,
    "amountOutUSD": 249.87,
    "slippagePercentage": 1,
    "marketImpactPercentage": 0.04,
    "poolFeesPercentage": 0.3,
    "tokenIn":  { "address": "0xEee…EEeE", "symbol": "ETH",  "decimals": 18 },
    "tokenOut": { "address": "0x8335…",    "symbol": "USDC", "decimals": 6  },
    "requestId": "f8b2…",
    "details": {
      "route": {
        "hops": [
          { "poolAddress": "0x4C36…", "exchange": "Uniswap V3", "poolType": "v3", "feeBps": 5 }
        ],
        "totalFeePercentage": 0.05,
        "aggregator": "kyberswap"
      }
    },
    "fee": { "amount": "0.0005", "percentage": 0.5, "wallet": "0x…", "deductedFrom": "input" },
    "evm": {
      "transaction": {
        "to":       "0xMobulaRouter…",
        "from":     "0xUserWallet…",
        "data":     "0xCALLDATA…",
        "value":    "100000000000000000",
        "gasLimit": "350000",
        "chainId":  8453,
        "approvalAddress": "0xMobulaRouter…",
        "approvals": [{ "token": "0xUSDC…", "spender": "0xMobulaRouter…" }]
      }
    },
    "solana": null,
    "ton": null
  }
}

data.evm.transaction fields

FieldTypeDescription
to0x…MobulaRouter contract on the target chain
from0x…Echo of walletAddress
data0x…Encoded call to MobulaRouter — pass through verbatim to your wallet
valuestring weiNative token to attach (= amountIn for native-in swaps, else 0)
gasLimitstring?Suggested gas (your wallet may simulate to refine)
gasPrice / maxFeePerGas / maxPriorityFeePerGasstring? weiFilled per chain (legacy or EIP-1559)
noncenumber?Optional — wallet picks if omitted
chainIdnumberEIP-155 chain id matching chainId query param
approvalAddress0x…?Where the user must approve() the sell token (defaults to to)
approvals{token, spender}[]?Pre-flight approval list — execute these before eth_sendTransaction

Signing

// 1. Execute pre-flight approvals if any (one approve() per (token,spender)).
for (const { token, spender } of quote.data.evm.transaction.approvals ?? []) {
  await wallet.writeContract({ address: token, abi: ERC20, functionName: 'approve', args: [spender, MAX] });
}

// 2. Send the swap tx.
const txHash = await wallet.request({
  method: 'eth_sendTransaction',
  params: [{
    to:    quote.data.evm.transaction.to,
    data:  quote.data.evm.transaction.data,
    value: quote.data.evm.transaction.value,
    gas:   quote.data.evm.transaction.gasLimit,
  }],
});
The wallet broadcasts directly — no /swap/send call needed for EVM (the call goes straight from the user’s wallet to their RPC).

Routing

All EVM swaps go through MobulaRouter, deployed identically on each supported chain. Under the hood it dispatches to the best aggregator (KyberSwap, NAOS, Li.Fi) — pick one explicitly via onlyRouters or let the API choose. DEX filtering (Uniswap V2/V3/V4, Curve, Balancer, PancakeSwap, Aerodrome, Velodrome, Sushi, …) via onlyProtocols / excludedProtocols.

Limits

  • Approvals required for any non-native sell token. Always check approvals[] and execute first.
  • Gas estimationgasLimit is a router-level upper bound. Wallets typically simulate to tighten.
  • Address case — both lowercased and EIP-55 checksummed accepted on input.