Transaction Flow
Simulate Phase
The simulate endpoint executes your transaction on a forked EVM state at the current block. This produces:
You specify
tokenIn, tokenOut, and amountIn to tell Quoter which token flows to track during simulation. The simulation metadata is cached for 5 minutes.
Validate Phase
The validate endpoint compares your unsigned transaction against the cached simulation. Each field is checked independently:
The
valid field is true only when all individual checks pass. If any check fails, you know exactly which field was modified.
Security Model
The simulate-then-validate pattern prevents a class of attacks where transaction data is modified between the time a user reviews it and the time they sign it:- Frontrunning protection — The simulated
amountOutshows what the user will actually receive, not an optimistic estimate. - Calldata integrity — The
datafield is compared by hash, so any byte-level change to the calldata is detected. - Address verification — Both
toandfromaddresses are validated, preventing contract address substitution attacks. - Value integrity — The native token
valueis checked to prevent unauthorized ETH transfers.
Source Agnostic
Quoter does not require transactions to originate from Enso APIs. Any valid EVM transaction calldata can be simulated and validated:- DEX aggregators — 0x, Paraswap, Odos
- DeFi protocols — Aave, Compound, Uniswap, Yearn
- Custom contracts — Your own smart contract interactions
- Multisig operations — Gnosis Safe or other multi-signature wallet transactions
- Smart account operations — ERC-4337 UserOps via
operationType: 1(DelegateCall)
Updated
