trace_call
https://api.triport.io/v1/polygonSimulate a transaction against Polygon state and return its full Parity-style execution trace — without broadcasting anything on-chain.
trace_call executes a single call against the chain state at a given block
(no broadcast, no state mutation) and returns the complete Parity trace
array for that call. Optionally it also returns a state diff and/or a low-level
VM trace, depending on the trace types you request.
It is the lightweight sibling of trace_block: instead of
re-executing every transaction in a block, it runs exactly one call, so it is
fast enough for interactive and pre-confirmation use. The primary use case is
MEV pre-confirmation analysis — simulate a candidate transaction (or a
single leg of a sandwich bundle) and read the full internal call tree to
compute expected profit before you sign and broadcast. A plain eth_call
only returns the final return data; trace_call exposes every internal call,
value transfer, and (optionally) storage change along the way.
This is a premium capability: it requires the polygon_trace scope and Pro
tier or higher. Calls below Pro tier are rejected with -32002, and calls
that exceed your tier's per-second rate are rejected with -32003.
Parameters
Positional params array: [transaction, traceTypes, blockTag].
transactionobjectrequiredtraceTypesarray of stringrequired"trace", "vmTrace", "stateDiff".blockTagstringoptionallatest, earliest, pending) to execute against. Defaults to latest.transaction fieldsobjectfromstringoptionaltostringoptionalgasstringoptionalgasPricestringoptionalvaluestringoptionaldatastringoptionalResponse
Response fields
The result object:
| Field | Type | Description |
|---|---|---|
output | string | Return data of the simulated call (hex). |
trace | array | Parity call frames. Each frame carries action, result, subtraces, traceAddress, and type. |
stateDiff | object | null | Per-address state changes. Populated only when "stateDiff" is included in traceTypes; otherwise null. |
vmTrace | object | null | Low-level VM execution trace. Populated only when "vmTrace" is included in traceTypes; otherwise null. |
Each entry in trace describes one internal call frame:
| Frame field | Type | Description |
|---|---|---|
action | object | The call itself — callType, from, to, gas, input, value. |
result | object | Outcome — gasUsed and output. |
subtraces | number | Count of direct child frames. |
traceAddress | array of number | Position of this frame within the call tree. |
type | string | Frame type, e.g. call, create, delegatecall, staticcall. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient (HTTP 403) — method requires Pro tier or higher | The key's tier is below Pro, or the polygon_trace category is not enabled for it. The error data includes required_tier, current_tier, and upgrade_url. |
-32003 | rate_limited (HTTP 429) — per-second limit exceeded for the current tier | You exceeded your tier's rps (Pro 3 / Business 10). The error data includes limit_rps, burst_capacity, and retry_after_sec. |
See the shared errors reference for the full error
envelope and the structure of the data field.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/polygon", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "trace_call",
params: [
{
from: "0xa1b2c3d4e5f60718293a4b5c6d7e8f9001122334",
to: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
value: "0x0",
data: "0x70a08231000000000000000000000000a1b2c3d4e5f60718293a4b5c6d7e8f9001122334",
},
["trace"],
"latest",
],
}),
});
const { result } = await res.json();
console.log(result.trace);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const result = await client.polygon.rpc("trace_call", [
{
from: "0xa1b2c3d4e5f60718293a4b5c6d7e8f9001122334",
to: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
value: "0x0",
data: "0x70a08231000000000000000000000000a1b2c3d4e5f60718293a4b5c6d7e8f9001122334",
},
["trace"],
"latest",
]);
console.log(result.output, result.trace);Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
result = client.polygon.rpc(
"trace_call",
[
{
"from": "0xa1b2c3d4e5f60718293a4b5c6d7e8f9001122334",
"to": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
"value": "0x0",
"data": "0x70a08231000000000000000000000000a1b2c3d4e5f60718293a4b5c6d7e8f9001122334",
},
["trace"],
"latest",
],
)
print(result["output"], result["trace"])Notes
- Trace types control payload size. Request only what you need.
["trace"]returns the call tree and is the lightest option. Adding"stateDiff"returns every touched storage slot, and"vmTrace"returns a per-opcode execution log — both can grow the response substantially. - Pre-confirmation MEV workflow. Simulate a candidate transaction against
latest(orpending) state, walk the returnedtraceto follow internal token flows and value transfers, and compute expected profit before signing. Because nothing is broadcast, you can probe many candidate inputs cheaply. - Parity shape, not Geth. This method returns the Parity
traceformat (action/result/subtraces/traceAddress). It is a different shape from Geth-style debug tracing — if your tooling consumes the Gethcallstree, you will need an adapter. - Block tags. Use
latestfor real-time pre-confirmation analysis and a hex block number for reproducible historical simulation.pendingreflects the current pending state. - Related methods:
trace_block(full block call tree),trace_transaction(trace one already-mined tx),trace_filter(range/address filter over historical traces), andtrace_replayBlockTransactions(full block replay with state diff). For an unsimulated read of final state only, useeth_call.