Transactions API
What would this transaction do if I sent it?
Runs an unsigned EVM or Solana transaction against the latest state: success or revert and why, gas or compute units, return data, events or program logs — without sending it.
/api/external/transaction-analysis/transaction-simulation/{chain}What it returns
Runs an unsigned transaction against the chain's latest state without signing or sending it, and answers whether it would succeed, revert, or fail because the sender cannot pay; the revert reason; the gas it would use; what it returns; the events it would emit; and the native coin it would move. Token balance changes are read from the emitted Transfer events. No signature, nonce or fee is checked, and the answer holds only for the state it ran against: the next block can change it. On ARC and STABLE, events and native transfers are not available (null), and on STABLE neither is the gas used. On BASE, when the chain's own simulation is unavailable, a second simulator answers; it reports no return data, revert data, revert message or native transfers (null), and it is not used when gas is set. On SOL the body is { transaction } alone: a legacy or version 0 transaction, serialized and base64-encoded, signed or not — signatures are not checked and the latest blockhash replaces the one it was built with. SOL answers the outcome, the failing instruction and its error as revertReason, compute units as gasUsed, the program's return data and the program log lines (programLogs); it has no revert bytes, events or native transfers (null).
Chains
- Solana SOL
- BNB Chain BNB
- Ethereum ETH
- Stable STABLE
- Base BASE
- Robinhood Chain RHC
- Arc ARC
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -X POST -H "x-dex-data-key: $DEXDATA_API_KEY" \
-H "content-type: application/json" \
-d '{"from":"<from>","to":"<to>","data":"<data>","value":"<value>","gas":"<gas>","transaction":"<transaction>"}' \
"https://api.dexdata.io/api/external/transaction-analysis/transaction-simulation/SOL"| Parameter | Description |
|---|---|
chainpath · string · required | ETH, BNB, BASE, RHC, ARC, STABLE or SOL. On ARC and STABLE the answer carries no events or native transfers (null), and on STABLE no gas figure either. On BASE, when the chain's own simulation is unavailable, a second simulator answers, with no return data, revert data, revert message or native transfers (null). SOL takes a different body — { transaction }, the serialized transaction — and answers compute units as gasUsed and its program log lines as programLogs. CELO, ARB, OP and SCROLL return 400 here. |
frombody · string · optional | EVM chains, required: the sending wallet, 0x followed by 40 hexadecimal characters. |
tobody · string · optional | EVM chains, required: the recipient or contract called, 0x followed by 40 hexadecimal characters. |
databody · string · optional | The calldata, 0x-prefixed hex of whole bytes. Optional; defaults to 0x (a plain transfer). |
valuebody · string · optional | Native coin sent, in wei, as a decimal string. Optional; defaults to "0". |
gasbody · integer · optional | The gas limit, 21000 to 30000000. Optional; when absent the chain picks a limit high enough to run the call. |
transactionbody · string · optional | SOL only, and then the only field: the transaction serialized and base64-encoded, at most 1232 bytes, legacy or version 0. Unsigned is fine: signature slots may be zeroes. Any recent blockhash works; the latest one replaces it. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
outcome | string | success: the transaction would run to completion. reverted: it would fail and undo every change it made. insufficient-funds: the sender does not hold the value sent plus gas (on SOL: the fee payer cannot pay the fee), so it could not run at all — every other field is then null. |
revertReason | string | null | The contract's revert message, decoded from the revert data when it is a standard text error, or Panic(0x..) for a failed assertion or arithmetic error. null when the transaction does not revert, or reverts with a custom error or with no data — read revertData for those — and on BASE when the second simulator answered, which reports that a call reverts but not why. On SOL: the failing instruction and its error, e.g. Instruction 0: custom program error: 0x1, or the transaction-level error when it could not run, e.g. AddressLookupTableNotFound. |
revertData | string | null | The raw revert data, lowercase hex, for decoding a custom error. null when the transaction does not revert or the chain reported no revert data, on BASE when the second simulator answered, and always on SOL. |
gasUsed | integer | null | The gas the run used, reverted runs included; on SOL, the compute units it consumed. null for insufficient-funds, on STABLE, where the chain does not report it, and on SOL when the transaction could not run at all — never 0. |
returnData | string | null | What the call returned, lowercase hex; 0x when it returned nothing. null unless the outcome is success, and on BASE when the second simulator answered. On SOL, the return data a program set, if any. |
logs | object[] | null | The events the transaction would emit, in order, native transfers excluded (they are in nativeTransfers). [] when it emits none or reverts. null on ARC and STABLE, where events are not available, on SOL, which has no events (read programLogs), and for insufficient-funds. |
logs[].address | string | The contract that emitted the event, lowercase. |
logs[].topics | string[] | The indexed topics, lowercase; the first is the event signature hash. |
logs[].data | string | The non-indexed event data, lowercase hex. |
nativeTransfers | object[] | null | Every movement of the native coin as the chain traces it — the top-level value, and value moved by contracts during the run — in order. [] when none or when it reverts. null on ARC, STABLE and SOL, where they are not available, on BASE when the second simulator answered, and for insufficient-funds. |
nativeTransfers[].from | string | The sender of the native coin, lowercase. |
nativeTransfers[].to | string | The recipient of the native coin, lowercase. |
nativeTransfers[].valueWei | string | The amount in wei, as a decimal string. |
programLogs | string[] | null | SOL only: the log lines the programs printed during the run, in order — invocations, messages, compute units consumed, success or failure. null on every EVM chain and for insufficient-funds. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key