Mobula
Configuration
An API key is required. Create one at admin.mobula.io.
import { createConfig, mobula } from "@spandex/core";
export const config = createConfig({
providers: [
mobula({
apiKey: "YOUR_MOBULA_API_KEY",
// Optional DEX / upstream router filters.
onlyProtocols: ["uniswap-v3"],
excludedProtocols: [],
onlyRouters: ["kyberswap", "lifi"],
}),
// ...
],
});Notes
- Quotes are fetched from
GET /swap/quoting, which returns an unsigned EVM transaction alongside the quote, so every quote includes broadcast-ready calldata. - No chain allow list is maintained client-side. Requests for chains Mobula does not support are rejected by the API and returned as failed quotes. See Mobula's docs for current chain coverage.
- Mobula uses the EIP-7528 sentinel (
0xEeee…EEeE) for native tokens. spanDEX translates its zero-address native convention automatically. - ERC-20 input swaps require an approval to the address Mobula reports in
approvalAddress(falling back to the routertoaddress). - Integrator fees are supported:
integratorSwapFeeBpsandintegratorFeeAddressmap to Mobula'sfeePercentages/feeWalletsparameters. Mobula retains a share of referral fees; see their docs. - A separate
recipientAccountis forwarded asrecipientAddress. - Routing failures are returned by Mobula as HTTP 200 with a
nulldata payload and anerrormessage. The adapter surfaces these as failed quotes. - Override
baseUrlonly if you are pointed at a non-default Mobula deployment.