Overview

Routers extend Gateway functionality with swap capabilities, enabling any-to-any token transfers across chains.
RouterLocationPurpose
GatewayRouterSource chainSwap input token → bridge asset
SolverRouterDestination chainSwap payout → output token

GatewayRouter (Source Chain)

The GatewayRouter handles pre-bridge swaps and partner integrations.

Swap & Bridge Flow

User sends ETH

GatewayRouter receives ETH

Swaps ETH → USDC via DEX aggregator

Calls Gateway.bridgeToken()

Intent created with USDC

Contract Interface

// Swap any ERC20 token and bridge
function swapAndBridge(
    address inputToken,
    uint256 inputAmount,
    bytes calldata swapData,      // DEX aggregator calldata
    uint256 destChainId,
    address destRecipient,
    uint256 minOutput,
    uint256 expiry
) external;

// Bridge native token (ETH, BNB, etc.)
function bridgeNative(
    uint256 destChainId,
    address destRecipient,
    uint256 minOutput,
    uint256 expiry
) external payable;

// Partner mode with fee collection
function partnerBridge(
    address inputToken,
    uint256 inputAmount,
    address partnerAddress,
    uint256 partnerFee,
    uint256 destChainId,
    address destRecipient,
    uint256 minOutput,
    uint256 expiry
) external;

Partner Mode

Partners (CEXes, wallets, enterprise apps) can integrate with custom fee arrangements:
1

Fee Collection

Router collects fees using Gateway fee logic
2

Partner Fee

Additional partner fee deducted and sent to partner address
3

Net Amount

Remaining amount passed to Gateway for intent creation

SolverRouter (Destination Chain)

The SolverRouter handles post-payout swaps on the destination chain.

Receive & Swap Flow

Solver executes intent

Payout goes to SolverRouter

SolverRouter swaps USDC → ARB

ARB delivered to user

Contract Interface

// Execute intent with destination swap
function executeAndSwap(
    bytes32 orderId,
    address recipient,
    address outputToken,
    bytes calldata swapData      // DEX aggregator calldata
) external;

Whitelisted DEX Aggregators

Routers only interact with pre-approved DEX aggregators for security:

Audit Required

All aggregators must pass security review

Rate Limited

Spending limits prevent large-scale exploits

Monitored

All swap activity is tracked and analyzed

Revocable

Compromised aggregators can be removed instantly

Leftover Handling

If a swap produces leftover tokens (due to slippage or rounding):
  • ERC20 leftovers — Returned to the user automatically
  • Native token leftovers — Returned to the user automatically
  • No stuck funds — Router contracts don’t hold balances

Use Cases

User → GatewayRouter.bridgeNative()

Wallet UI calls Router directly with native token.
Router handles swap and Gateway interaction.
Next: Learn about SolverPool — isolated liquidity vaults.