simulationId for subsequent validation.
Request Parameters
Top-level fields
| Field | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Chain ID (e.g., 1 for Ethereum, 42161 for Arbitrum) |
transaction | TransactionDto | Yes | The transaction to simulate (see below) |
tokenIn | string[] | Yes | Input token addresses |
tokenOut | string[] | Yes | Output token addresses to track |
amountIn | string[] | Yes | Input amounts in wei (one per tokenIn) |
preSimulationTransactions | TransactionDto[] | No | Setup transactions to run before the main simulation |
Transaction fields
| Field | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Hex-encoded calldata |
value | string | Yes | Native token value in wei |
to | string | Yes | Target contract address |
from | string | Yes | Sender address |
operationType | number | No | 0 = Call (default), 1 = DelegateCall |
receiver | string | No | Token receiver address (if different from sender) |
spender | string | No | Spender address for token approvals |
executor | string | No | Contract executor address |
origin | string | No | Original caller address |
authorityDelegate | string | No | Delegation authority address |
initCode | string | No | Init code for contract creation |
Response
| Field | Type | Description |
|---|---|---|
simulationId | string | UUID for this simulation. Use with /validate. |
chainId | number | Chain ID the simulation ran on |
result.status | "Success" | "Error" | Whether the simulated transaction would succeed |
result.amountOut | string[] | Predicted output amounts in wei (one per tokenOut) |
result.gas | string | Gas consumed during simulation |
result.error | object | Error details when status is "Error" |
Examples
- Token Swap
- Vault Deposit
- DelegateCall
Simulate a swap from ETH to USDC on Ethereum mainnet.
Handling Simulation Errors
Whenresult.status is "Error", the result.error field contains details about why the transaction would fail. Common causes:
- Contract revert — The transaction would revert on-chain (e.g., insufficient balance, failed require check)
- Invalid calldata — The
datafield doesn’t match any function signature on the target contract - Out of gas — The transaction requires more gas than available
Updated
