Cross-Chain Swaps

Cross-chain swaps (bridging) let you move tokens between different blockchain networks through a single API call. Suwappu handles the routing, bridging protocol selection, and settlement automatically.

How It Works

To perform a cross-chain swap, include both from_chain and to_chain parameters in your POST /quote request. When these differ, Suwappu routes the transaction through the optimal bridge.

POST /quote
{
  "from_token": "USDC",
  "to_token": "USDC",
  "amount": "1000",
  "from_chain": "ethereum",
  "to_chain": "arbitrum"
}

The quote response includes the expected output amount after bridge fees and slippage. Execute the quote the same way as a single-chain swap -- via POST /swap/execute.

Important Considerations

  • Settlement time: Cross-chain swaps take longer than same-chain swaps. Ethereum to L2 bridges typically complete in 1-15 minutes. L2 to L1 withdrawals can take longer depending on the bridge used.

  • Bridge fees: The quoted output amount accounts for bridge fees. The expected_output field reflects what you will receive after all fees.

  • Status tracking: Use GET /swap/status/{swapId} to poll for completion. Cross-chain swaps may stay in "pending" status longer than same-chain swaps.

  • Token availability: Not all token pairs are available for cross-chain swaps. The quote endpoint will return an error if no route is found.

Full Example: Bridge USDC from Ethereum to Arbitrum

Step 1: Get a Cross-Chain Quote

Example Response

Step 2: Execute the Swap

Example Response

Step 3: Check Status Until Complete

Example Response (in progress)

Example Response (completed)

Python Example

TypeScript Example

Supported Cross-Chain Routes

Cross-chain swaps are supported between all EVM chains. The most common routes include:

  • Ethereum to/from L2s (Arbitrum, Optimism, Base)

  • Between L2s (e.g., Arbitrum to Base)

  • Stablecoin bridges (USDC, USDT) across any EVM pair

Use the POST /quote endpoint to check if a specific route is available. If no bridge route exists, the API returns an error with a descriptive message.

Last updated