sideswap_execute_swap
Execute a Liquid atomic swap on SideSwap after confirming the quote. Locally verifies the swap against the agreed terms and aborts if the balance change does not match, protecting against a hostile server.
Instructions
Execute a Liquid atomic swap on SideSwap. Both directions are supported via send_bitcoins: True = L-BTC → asset (default), False = asset → L-BTC. The PSET returned by SideSwap is verified locally against the agreed quote BEFORE signing — the swap is aborted if the wallet's net balance change does not exactly match (refusing to sign protects against a hostile server). The fee tolerance is pinned to L-BTC, so on the asset → L-BTC direction the asset side is checked at strict equality. Order is persisted at every step for crash recovery. ALWAYS call sideswap_quote first and confirm the price with the user before invoking this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset_id | Yes | Non-L-BTC Liquid asset (e.g. USDt). The L-BTC side is always the policy asset. | |
| password | No | Password to decrypt mnemonic (if encrypted at rest) | |
| send_amount | Yes | Send amount in sats (L-BTC if send_bitcoins, else asset) | |
| wallet_name | No | Liquid wallet to sign with | default |
| send_bitcoins | No | True = send L-BTC to receive asset; False = send asset to receive L-BTC | |
| min_recv_amount | No | Optional floor on the dealer's recv_amount in sats. Pass the recv_amount the user just confirmed in sideswap_quote — if the rate moved between preview and execution and the dealer offers less, the swap is rejected before signing. | |
| flexible_small_amount | No | When True, accept dealer-rounded send_amount up to ±3000 sats from what was requested. SideSwap's mkt::* dealer rounds internally; small swaps (e.g. 5k–25k sats) often come back at a slightly different amount. Off by default — strict equality is safer at scale. |