Skip to main content

What is a forked EVM simulation?

A forked EVM simulation runs your transaction against a copy of current chain state. Enso Quoter uses this to predict amountOut, gas, and whether the call would succeed.

J
Written by Javier Diaz

A forked EVM simulation runs your transaction against a copy of current chain state, without sending it on-chain. Enso Quoter uses that model to predict amountOut, gas, and whether the call would succeed.

Definition

Instead of broadcasting a transaction, the simulator copies the chain’s current block state and executes your calldata there. The result shows what would happen if that transaction were mined against that state: success or error, gas consumed, and the output amounts you asked it to track.

How it works

  • The service takes a fork at the current block and executes the transaction (after any preSimulationTransactions).

  • You specify tokenIn, tokenOut, and amountIn so it can report predicted output for the tokens you care about.

  • result.status is "Success" or "Error". On error, result.error has details.

  • The amountOut is accurate at simulation time. State can still change before the transaction is mined, so the calldata should include slippage protection.

  • Quoter can also cache that result as a simulationId for a later integrity check.

How Enso does this

POST https://quoter.api.enso.build/api/v1/simulate runs the fork and returns simulationId, result.status, result.amountOut, and result.gas. See How It Works. The Route API also simulates internally when it builds a path, but that is a different call: Route finds the path and returns signer-ready tx data. Quoter simulates a transaction you already built.

FAQ

Does a forked simulation require the tokens to be in the wallet?

Quoter can simulate without the actual tokens in the wallet, so you can test before you commit. See the Quoter overview.

Will the on-chain result always match the fork?

It matches the state at simulation time. Between then and inclusion, other transactions can change storage or prices, which is why slippage protection in the calldata still matters.

Related articles

  • How accurate is the Quoter gas estimate?

  • Can I simulate a transaction without holding the tokens?

  • Transaction simulation vs eth_call

  • What is transaction simulation in DeFi?

  • What is Enso Quoter?

Sources

Did this answer your question?