simulate_swap
Simulate a token swap on Uniswap V3 to verify expected output, price impact, and gas costs before executing.
Instructions
Simulates a token swap via Uniswap V3 and returns the expected output, price impact, and gas estimate. ALWAYS call this before execute_swap to verify the trade is viable. Returns a simulation_id that must be passed to execute_swap.
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>"
},
"name": "simulate_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_id | No | Chain ID. Default: 1 (Ethereum mainnet). | |
| to_token | Yes | Token to buy. Use symbol or contract address. | |
| amount_in | Yes | Amount to sell in human-readable units. Example: "1.5" for 1.5 ETH. | |
| from_token | Yes | Token to sell. Use symbol (ETH, USDC, WBTC) or contract address. | |
| slippage_tolerance | No | Max slippage tolerance in percentage. Example: 0.5 = 0.5%. |