execute_swap
Executes a token swap on Uniswap V3 after simulation. Pass the simulation ID to finalize the trade securely.
Instructions
Executes a token swap via Uniswap V3. You MUST call simulate_swap first and pass the returned simulation_id here. Returns a transaction_id to track the status with get_transaction_status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_token | Yes | Token to sell. Must match simulate_swap call. | |
| to_token | Yes | Token to buy. Must match simulate_swap call. | |
| amount_in | Yes | Amount to sell. Must match simulate_swap call. | |
| chain_id | No | Chain ID. Default: 1 (Ethereum mainnet). | |
| slippage_tolerance | No | Max slippage tolerance in percentage. Example: 0.5 = 0.5%. | |
| simulation_id | Yes | The simulation_id returned by simulate_swap. Required for safety. |