trace_call — Polygon JSON-RPC

Status: Available

Trace format. This interface returns Parity-style call frames. Where the response includes vmTrace and stateDiff, both are null: opcode traces and state diffs are not supported. For trace_callMany, calls are independent simulations and do not share the state changes of preceding calls.

POSThttps://triport.io/polygon
Network
Polygon
Scope
polygon_trace
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
Pro — 3 rps · Business — 10 rps (burst above the steady rate is allowed; no daily quota)

Endpoint and plans: Polygon RPC endpoint.

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 HTTP 403 tier_insufficient, and calls that exceed your tier's per-second rate are rejected with HTTP 429.

Parameters

Positional params array: [transaction, traceTypes, blockTag].

transactionobjectrequired
The call object to simulate (see fields below).
traceTypesarray of stringrequired
Use ["trace"] for call frames. The vmTrace and stateDiff fields are unsupported and remain null.
blockTagstringoptional
Block number (hex) or tag (latest, earliest, pending) to execute against. Defaults to latest.
transaction fieldsobject
fromstringoptional
20-byte sender address (hex). Defaults to the zero address.
tostringoptional
20-byte recipient / contract address (hex).
gasstringoptional
Gas limit (hex quantity).
gasPricestringoptional
Gas price in wei (hex quantity).
valuestringoptional
Value to send in wei (hex quantity).
datastringoptional
Call data — encoded function selector + arguments (hex).

Response

Response fields

The result object:

FieldTypeDescription
outputstringReturn data of the simulated call (hex).
tracearrayParity call frames. Each frame carries action, result, subtraces, traceAddress, and type.
stateDiffnullUnsupported by this interface; always null, including when requested.
vmTracenullUnsupported by this interface; always null, including when requested.

Each entry in trace describes one internal call frame:

Frame fieldTypeDescription
actionobjectThe call itself — callType, from, to, gas, input, value.
resultobjectOutcome — gasUsed and output.
subtracesnumberCount of direct child frames.
traceAddressarray of numberPosition of this frame within the call tree.
typestringFrame type, e.g. call, create, delegatecall, staticcall.

Errors

CodeMeaningWhen it happens
403tier_insufficient (HTTP 403) — method requires Pro tier or higherThe 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.
429rate_limited (HTTP 429) — per-second limit exceeded for the current tierYou 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://triport.io/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);

Notes

  • Supported output. Request ["trace"]; state diffs and opcode traces remain unavailable.
  • Pre-confirmation MEV workflow. Simulate a candidate transaction against latest (or pending) state, walk the returned trace to 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 trace format (action / result / subtraces / traceAddress). It is a different shape from Geth-style debug tracing — if your tooling consumes the Geth calls tree, you will need an adapter.
  • Block tags. Use latest for real-time pre-confirmation analysis and a hex block number for reproducible historical simulation. pending reflects 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), and trace_replayBlockTransactions (full block replay with state diff). For an unsimulated read of final state only, use eth_call.