execute_swap
After simulation, execute the token swap via Uniswap V3. Returns a transaction ID for status tracking.
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.
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": {
"from_token": "<from_token>",
"to_token": "<to_token>",
"amount_in": "<amount_in>",
"simulation_id": "<simulation_id>"
},
"name": "execute_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_id | No | Chain ID. Default: 1 (Ethereum mainnet). | |
| to_token | Yes | Token to buy. Must match simulate_swap call. | |
| amount_in | Yes | Amount to sell. Must match simulate_swap call. | |
| from_token | Yes | Token to sell. Must match simulate_swap call. | |
| simulation_id | Yes | The simulation_id returned by simulate_swap. Required for safety. | |
| slippage_tolerance | No | Max slippage tolerance in percentage. Example: 0.5 = 0.5%. |