Skip to main content
POST
/
api
/
v1
/
simulate
Simulate a transaction
curl --request POST \
  --url https://shield.api.enso.build/api/v1/simulate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chainId": 1,
  "transaction": {
    "data": "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000066c5a817",
    "value": "1000000000000000000",
    "to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E",
    "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "operationType": 123,
    "receiver": "<string>",
    "spender": "<string>",
    "executor": "<string>",
    "origin": "<string>",
    "authorityDelegate": "<string>",
    "initCode": "<string>"
  },
  "tokenIn": [
    "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
  ],
  "tokenOut": [
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
  ],
  "amountIn": [
    "1000000000000000000"
  ],
  "preSimulationTransactions": [
    {
      "data": "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000066c5a817",
      "value": "1000000000000000000",
      "to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E",
      "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      "operationType": 123,
      "receiver": "<string>",
      "spender": "<string>",
      "executor": "<string>",
      "origin": "<string>",
      "authorityDelegate": "<string>",
      "initCode": "<string>"
    }
  ]
}
'
{
  "simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "chainId": 1,
  "result": {
    "status": "Success",
    "amountOut": [
      "<string>"
    ],
    "gas": "<string>",
    "error": "<unknown>"
  }
}

Authorizations

Authorization
string
header
required

Enso API key passed as Bearer token in Authorization header

Body

application/json

Request to simulate a transaction

chainId
integer<int64>
required

Chain ID (e.g., 1 for Ethereum mainnet)

Required range: x >= 0
Example:

1

transaction
object
required

The transaction to simulate

tokenIn
string[]
required

Input token addresses

Example:
[
  "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
]
tokenOut
string[]
required

Output token addresses to track

Example:
[
  "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
]
amountIn
string[]
required

Input amounts in wei (one per tokenIn)

Example:
["1000000000000000000"]
preSimulationTransactions
object[] | null

Optional setup transactions to execute before the main simulation (e.g., token approvals)

Response

Simulation completed (check result.status for success or error)

Response from the simulate endpoint

simulationId
string<uuid>
required

Unique identifier for this simulation. Use with /validate to verify transactions before signing.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

chainId
integer<int64>
required

Chain ID the simulation was run on

Example:

1

result
object
required

Simulation result containing status, output amounts, and gas