The routes field allows for multi-hop swaps through multiple pools. The swap will execute through each pool in sequence before the IBC transfer.
Slippage Protection
The token_out_min_amount field ensures that the user receives at least the specified amount of output tokens, protecting against price slippage during the swap.
IBC Transfer Details
The ibc_transfer_info field specifies:
source_channel: The IBC channel to send tokens through
receiver: The address on the destination chain to receive the tokens
memo: Optional memo to include with the IBC transfer
timeout_timestamp: The timestamp after which the IBC transfer will timeout
Atomic Execution
This message executes atomically:
Swap tokens through the specified route(s)
Verify minimum output amount is met
Send output tokens via IBC transfer
If any step fails, the entire transaction is rolled back and no state changes are committed.
Swap Fees
Each pool in the swap route charges a swap fee, which is deducted from the input amount before the swap is executed. The IBC transfer fee is also deducted from the output tokens.
Affiliate Fees
The affiliates field allows you to specify fee recipients who will receive a portion of the swap output before the IBC transfer. Affiliate fees are:
Optional: If not specified, no affiliate fees are deducted
Calculated on output: Fees are calculated on the swap output amount (before IBC transfer)
Multiple affiliates: You can specify multiple affiliates, each receiving their specified fee
Basis points: Fees are specified in basis points (1 basis point = 0.01%)
Example: If a swap outputs 1,000,000 tokens and you specify an affiliate with 10 basis points (0.1%):