write_account_swap
Swaps assets within an Arcadia account in one atomic transaction, with the backend selecting the optimal route. Use it for standalone swaps in an active position; returned calldata must be signed within 30 seconds.
Instructions
Flash-action: swaps assets within an Arcadia account in one atomic transaction. The backend finds the optimal swap route. NOTE: If you are closing a position (swap + repay + withdraw), prefer write_account_close which batches everything atomically. Only use this tool for standalone swaps within an active position. The returned calldata is time-sensitive: sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation: if tenderly_sim_status is 'false', do NOT broadcast the transaction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset_to | Yes | Token address to swap to | |
| chain_id | No | Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood) | |
| slippage | No | Basis points, 100 = 1% | |
| amount_in | Yes | Raw units | |
| asset_from | Yes | Token address to swap from | |
| account_address | Yes | Arcadia account address |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| before | No | ||
| description | No | ||
| transaction | Yes | ||
| price_checks | No | ||
| tenderly_sim_url | No | ||
| tenderly_sim_status | No | ||
| expected_value_change | No | ||
| expected_value_change_unavailable | No |