prepare_swap
Build a ready-to-execute THORChain swap. Returns the exact vault address to send to, the memo, the source chain, the expected output and guaranteed minimum, the estimated time, and an expiry. Use this when the user wants to actually perform a swap, not just price it (for pricing only, use quote_swap). The returned instruction is what a wallet signs and broadcasts; this tool itself never moves funds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to swap in THORChain base units (1e8; e.g. 50000000 = 0.5 BTC) | |
| to_asset | Yes | The target asset to swap to (e.g. ETH.ETH) | |
| affiliate | No | Optional affiliate address or THORName that collects a fee | |
| from_asset | Yes | The source asset to swap from (e.g. BTC.BTC) | |
| destination | Yes | The address on the destination chain that will receive the swap output. Required to execute a swap. | |
| affiliate_bps | No | Optional affiliate fee in basis points (0-1000; protocol caps total affiliate fees at 1000 bps) | |
| max_slippage_bps | No | Maximum acceptable slippage in basis points; sets the min-received limit baked into the memo (default 300 = 3%). Range 1-10000. |