relay_swap_multi_input
Execute cross-chain token swaps from multiple blockchain networks to a single destination, supporting both exact input and exact output trade types.
Instructions
Execute multi-chain token swaps. IMPORTANT: For EXACT_INPUT, do NOT include "amount" at root level - only in origins array. For EXACT_OUTPUT, include "amount" at root level. Always use TOKEN CONTRACT ADDRESSES. Examples:
EXACT_INPUT (Bridge 1 USDC from Ethereum to Optimism): {"user": "0x123...", "origins": [{"chainId": 1, "currency": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "amount": "1000000"}], "destinationChainId": 10, "destinationCurrency": "0x0b2c639c533813f4aa9d7837caf62653d097ff85", "tradeType": "EXACT_INPUT"}
EXACT_OUTPUT (Get exactly 100 USDC on Base): {"user": "0x123...", "amount": "100000000", "origins": [{"chainId": 1, "currency": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "amount": "50000000"}], "destinationChainId": 8453, "destinationCurrency": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "tradeType": "EXACT_OUTPUT"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | Yes | User wallet address that will make deposits and receive tokens | |
| origins | Yes | Array of origin tokens to swap from multiple chains | |
| destinationCurrency | Yes | Destination token contract address (e.g., "0x0b2c639c533813f4aa9d7837caf62653d097ff85" for USDC on Optimism) | |
| destinationChainId | Yes | Destination chain ID (e.g., 10 for Optimism, 8453 for Base, 42161 for Arbitrum) | |
| tradeType | Yes | EXACT_INPUT: Use exact amounts from origins. EXACT_OUTPUT: Get exact amount at destination (requires "amount" field) | |
| recipient | No | Optional: recipient address (defaults to user address) | |
| refundTo | No | Optional: refund address in case of failure | |
| amount | No | ONLY for EXACT_OUTPUT: exact amount to receive at destination (in smallest unit) | |
| txs | No | Optional: additional transactions to execute | |
| txsGasLimit | No | Gas limit for additional transactions | |
| partial | No | Allow partial fills if full amount not available | |
| referrer | No | Referrer address for fee sharing | |
| gasLimitForDepositSpecifiedTxs | No | Gas limit for deposit-specified transactions |