relay_get_quote
Get executable quotes for bridging tokens between blockchain networks or swapping tokens within the same chain using contract addresses.
Instructions
Get an executable quote for bridging tokens between chains or swapping within a chain. Always use TOKEN CONTRACT ADDRESSES, not symbols. Use relay_get_currencies to find token addresses.
Common Examples: • Bridge USDC Ethereum→Optimism: user="0x123...", originChainId=1, destinationChainId=10, originCurrency="0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", destinationCurrency="0x0b2c639c533813f4aa9d7837caf62653d097ff85", amount="1000000", tradeType="EXACT_INPUT" • Bridge USDC Ethereum→Base: originChainId=1, destinationChainId=8453, destinationCurrency="0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" • Same-chain swap on Ethereum: originChainId=1, destinationChainId=1, different token addresses
Token Format: Always use contract addresses (checksummed preferred) Amount Format: Smallest unit - "1000000"=1 USDC, "1000000000000000000"=1 ETH
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | Yes | User wallet address | |
| recipient | No | Recipient wallet address (defaults to user address) | |
| originChainId | Yes | Source chain ID (e.g., 1 for Ethereum, 10 for Optimism, 8453 for Base) | |
| destinationChainId | Yes | Destination chain ID | |
| originCurrency | Yes | Source token contract address (e.g., "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" for USDC on Ethereum) | |
| destinationCurrency | Yes | Destination token contract address (e.g., "0x0b2c639c533813f4aa9d7837caf62653d097ff85" for USDC on Optimism) | |
| amount | Yes | Amount in smallest unit (e.g., "1000000" = 1 USDC with 6 decimals, "1000000000000000000" = 1 ETH) | |
| tradeType | No | Trade type: EXACT_INPUT (specify input amount), EXACT_OUTPUT (specify exact output), EXPECTED_OUTPUT (expected output) |