# EVM Transaction Simulator

> EVM Transaction Simulator is a paid API for AI agents from x402-gateway-production.up.railway.app, paid per call via x402, $0.010000/call, status unknown (last checked 2026-09-13).

Simulate an EVM transaction before sending — returns gas estimates, execution traces, revert reasons, and state diffs

## Facts

- Endpoint: POST https://x402-gateway-production.up.railway.app/api/tx/simulate
- Price: $0.010000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-gateway-production-up-railway-app-2f23bad4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZnEx-lOEZ8-XrkYDvml9v

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 x402-gateway-production-up-railway-app-2f23bad4 -d '<json body>'
```

Example prompt: Before I send this transaction, can you simulate it on Ethereum mainnet — it's a call from 0x2222...2222 to 0x1111...1a0 with calldata 0xabcdef and value 0 ETH — tell me the gas estimate, whether it reverts, and the execution trace?

## When to prefer this

Use this endpoint when you need to pre-flight an EVM transaction before submitting it on-chain — especially to catch reverts, estimate gas accurately, or inspect execution traces without spending gas. Prefer this over on-chain submission when testing contract interactions, debugging DeFi calls, or validating calldata correctness. Best for Ethereum mainnet (chainId 1) simulations with full trace detail.

## Known failure modes

- Invalid or missing 'to'/'from' address — 400 bad request
- Unsupported chainId — simulation may fail or return incorrect results
- Malformed calldata hex string — trace returns empty or error
- Insufficient context for revert decoding — revert reason returned as raw hex
- Service unavailable — 5xx from upstream simulation provider
- Payment failure — x402 payment not accepted or insufficient USDC balance

## How this service works

Simulate EVM transactions before sending — get gas estimates, execution traces, and revert reasons

## Output

Returns a simulation result including: total gas used, full execution call trace (nested CALL/DELEGATECALL tree with inputs/outputs), emitted logs, nonce and balance diffs, decoded output if ABI available, block number and timestamp of simulation, and any revert reason if the transaction would fail.

## Example request

```json
{
 "to": "0x1111111254fb6590cd080b51a51f1d88f6d121a0",
 "data": "0x",
 "from": "0x3333333333333333333333333333333333333333",
 "value": "0",
 "chainId": 1
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "network_id": {
       "type": "string",
       "description": "Network ID (1=mainnet, 8453=Base, 10=Optimism, etc.)",
       "example": "1"
      },
      "from": {
       "type": "string",
       "description": "Sender address",
       "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
      },
      "to": {
       "type": "string",
       "description": "Recipient/contract address",
       "example": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      },
      "value": {
       "type": "string",
       "description": "ETH value in wei",
       "example": "0"
      },
      "data": {
       "type": "string",
       "description": "Transaction calldata (hex string)"
      },
      "gas": {
       "type": "number",
       "description": "Gas limit"
      }
     },
     "required": [
      "network_id",
      "from",
      "to"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-gateway-production-up-railway-app-2f23bad4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production.up.railway.app](https://www.zero.xyz/host/x402-gateway-production.up.railway.app/llms.txt)
