Executing a route
This page documents the executeRoute function, used to execute a token transfer/swap using a route from /v2/fungible/route API
Executing a cross-chain route
The executeRoute function is used to execute a route, including optional support for simulating transactions, injecting custom Cosmos messages, and tracking transaction status. You must provide a list of user addresses (one per chain in route.requiredChainAddresses), along with the route object returned from route (/v2/fungible/route).
Required fields
route
A RouteResponse containing swap or transfer operations.
userAddresses
One user address per chain in the same order as route.requiredChainAddresses.
getCosmosSigner
Function that takes a chainId and returns a Promise<OfflineSigner>
getEvmSigner
Function that takes a chainId and returns a Promise<WalletClient>
getSvmSigner
Function that returns a Promise<OfflineSigner>
Optional fields
slippageTolerancePercent
Set the maximum slippage tolerance for the route (defaults to “1”).
simulate
Whether to simulate transactions before executing (defaults to true).
batchSimulate
If true, simulate all transactions in a batch before execution; if false, simulate each transaction individually. (defaults to true).
beforeMsg / afterMsg
Optional Cosmos messages to inject at the beginning or end of the route execution.
useUnlimitedApproval
If true, sets Evm token allowances to MAX_UINT256. (defaults to false).
bypassApprovalCheck
If true, skips token approval checks on Evm. (defaults to false).
timeoutSeconds
Time in seconds to wait for message preparation before timing out.
getGasPrice
Override the gas price per chain.
getFallbackGasAmount
Fallback gas to use if simulation fails.
gasAmountMultiplier
Overrides the default simulation multiplier (default is 1.5).
Lifecycle callbacks
You can optionally provide the following callbacks:
onTransactionBroadcast
Called after each transaction is broadcasted.
onTransactionCompleted
Called after each transaction is confirmed.
onTransactionTracked
Called during confirmation polling, useful for progress tracking uis.