sideswap_execute_swap
Execute a SideSwap Liquid atomic swap in either direction, verifying the PSET against the agreed quote before signing to prevent hostile-server balance changes.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"asset_id": "<asset_id>",
"send_amount": "<send_amount>"
},
"name": "sideswap_execute_swap"
}
}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 |
| password_file | No | Path to a local file containing the wallet password; keeps the password out of the conversation. Do not combine with password. | |
| 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. |