simulate_swap
Simulate a token swap via Uniswap V3 to verify trade viability, returning expected output, price impact, gas estimate, and a simulation_id for execution.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_token | Yes | Token to sell. Use symbol (ETH, USDC, WBTC) or contract address. | |
| 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. | |
| chain_id | No | Chain ID. Default: 1 (Ethereum mainnet). | |
| slippage_tolerance | No | Max slippage tolerance in percentage. Example: 0.5 = 0.5%. |