# EVM Transaction Simulator

> EVM Transaction Simulator is a paid API for AI agents from defi.hugen.tokyo, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Simulates an EVM transaction before execution to preview gas costs, token balance changes, approval modifications, and detect sandwich attacks or unexpected transfers on any EVM chain

## Facts

- Endpoint: POST https://defi.hugen.tokyo/defi/simulate
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-hugen-tokyo-d6dc68d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hwDJvrAP31pFdgbMbo9cn

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability defi-hugen-tokyo-d6dc68d2 -d '<json body>'
```

Example prompt: Before I sign this transaction, can you simulate it on Ethereum mainnet and show me the expected gas cost, any token balance changes, approval changes, and whether it's vulnerable to a sandwich attack? Here's the raw transaction data: 0x...

## When to prefer this

Use this endpoint when you need to pre-flight any EVM transaction before broadcasting — especially for DeFi interactions involving token swaps, approvals, or bridge calls where gas cost predictability, MEV/sandwich attack risk, and unexpected side effects matter. Prefer this over manual gas estimation tools when you need a full simulation of balance changes, approvals, and security checks in a single call across any EVM-compatible chain.

## Known failure modes

- Invalid or malformed transaction data returns a parsing error
- Unsupported EVM chain ID returns an unsupported chain error
- Simulation reverts if the transaction would revert on-chain
- Insufficient USDC payment returns a 402 payment required response
- Network congestion or node unavailability may cause timeout errors

## How this service works

Simulate an EVM transaction before execution — preview gas costs, token balance changes, approval modifications, and detect sandwich attacks or unexpected transfers. Supports any EVM chain. Premium endpoint ($0.02). No API keys needed. Accepts USDC payments on Base and Solana

## Output

Returns a simulation result including estimated gas cost, token balance deltas for all affected addresses, any token approval modifications, detection of sandwich attack vectors, and flags for unexpected or anomalous transfers — all without broadcasting to the network.

## Example request

```json
{
 "to": "0x68b3465833fb72B5A828cCEEad996fc3cA6B0A89",
 "data": "0xa9059cbb0000000000000000000000001234567890123456789012345678901234567890000000000000000000000000000000000000000000000000016345785d8a0000",
 "from": "0x1234567890123456789012345678901234567890",
 "value": "0",
 "chain_id": 1,
 "gas_limit": "100000"
}
```

## Request schema (JSON Schema)

```json
{
 "properties": {
  "input": {
   "required": [
    "method"
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-hugen-tokyo-d6dc68d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi.hugen.tokyo](https://www.zero.xyz/host/defi.hugen.tokyo/llms.txt)
