Simulate a swap
simulate_swapBuild and dry-run a token swap from a given account via eth_call, returning the plan and simulation without signing or sending.
Instructions
Build the swap, then dry-run it from the given account with an eth_call on your node. Returns the plan and the simulation. Nothing is signed or sent.
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": {
"tokenIn": "<tokenIn>",
"tokenOut": "<tokenOut>",
"recipient": "<recipient>",
"from": "<from>"
},
"name": "simulate_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | the account the simulation runs from | |
| chain | No | base | eth | optimism | arbitrum | robinhood, or a numeric chain id. Optional when your RPC has a single chain. | |
| amount | No | input amount in human units, for example "1.5" | |
| tokenIn | Yes | input token: a 0x address, or a symbol such as ETH, WETH, USDC, BZPX | |
| version | No | protocol version: latest (default) | 1 | 2 | 2.0.0 | |
| amountIn | No | input amount in base units, as an integer string | |
| tokenOut | Yes | output token: a 0x address, or a symbol such as ETH, WETH, USDC, BZPX | |
| recipient | Yes | who receives tokenOut | |
| userMinOut | No | optional explicit minimum output, in base units of tokenOut | |
| deadlineSec | No | deadline horizon in seconds, 10-3600, default 120 | |
| slippageBps | No | 0-5000, default 50; never below the on-chain floor |