Skip to content
I

Intent Cost Simulator

Safe simulations for risky EVM moves

Created on 21st February 2026

•

I

Intent Cost Simulator

Safe simulations for risky EVM moves

The problem Intent Cost Simulator solves

DeFi intent execution is expensive to reason about. Before submitting a sequence of
transactions — swaps, loans, bridges, vault deposits — developers and solvers have no
easy way to answer: how much will this actually cost, and will it even succeed?

Intent Cost Simulator forks a live chain and replays your exact calldata against
real EVM state, giving you:

  • Per-step gas cost in USD at current gas prices
  • Cumulative flash liquidity required — the capital a solver needs to front the sequence
  • Revert detection — whether each step fails and why, before you spend real gas
  • Collateral scaffolding — simulate against seeded balances to isolate logic errors
    from capital constraints

Useful for protocol teams validating new intent flows, solvers pricing fill risk, and
auditors stress-testing execution paths without touching mainnet.

Challenges I ran into

Two concrete ones:

1. debug_traceCall not universally available
Some chains (including ADI) don't support the callTracer tracer, causing the entire
simulation to error mid-run rather than degrade gracefully. The fix was a fallback to
eth_call when the tracer fails — preserving revert detection while flagging gas
figures as estimated rather than measured. Still in progress for full parity.

2. Unicode panics in the terminal reporter
Column truncation was slicing strings at raw byte offsets, which panicked whenever a
label contained multi-byte characters like → or —. The fix was replacing all
direct byte slices with char_indices()-based truncation, and separating colorization
from width calculation so ANSI escape bytes don't corrupt column math.

Use of AI tools and agents

Claude and ChatGPT were used throughout for scaffolding — generating boilerplate for RPC client methods, the Anvil process management wrapper, and the reporter table layout. Useful for getting structure in place quickly, though most of the debugging and architecture decisions (fallback strategy, storage slot calculation, gas ceiling logic) required working through manually. Treated as a fast first draft, not a final answer.

Tracks Applied (4)

Devtopia

This is real EVM simulation of intent sequences with gas cost accounting, flash liquidity requirements, and revert analy...Read More

ERC-4337 Paymaster Devtools

Simulate ERC-4337 EntryPoint handleOps. If you add paymaster balance scaffolding to your unlimited_collateral phase and ...Read More
ADI Foundation

ADI Foundation

Open Project Submission

The simulator running against ADI chain can act as infrastructure for institutional DeFi tooling; gas cost predictabilit...Read More
ADI Foundation

ADI Foundation

Integrate the Uniswap API in your platform

Intent fragments in JSON contain UniV3 exactInputSingle, UniV3 exactInput multi-hop, and UniV4 UniversalRouter calls. ...Read More
Uniswap Foundation

Uniswap Foundation

Technologies used

Discussion

Builders also viewed

See more projects on Devfolio