TriportRPC

trace_call

POSThttps://api.triport.io/v1/polygon

Simulate a transaction against Polygon state and return its full Parity-style execution trace — without broadcasting anything on-chain.

Polygonpolygon_tracePro — 3 rps · Business — 10 rps (burst above the steady rate is allowed; no daily quota)

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].

transactionobjectrequired
The call object to simulate (see fields below).
traceTypesarray of stringrequired
Which trace outputs to return. Allowed values: "trace", "vmTrace", "stateDiff".
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.
stateDiffobject | nullPer-address state changes. Populated only when "stateDiff" is included in traceTypes; otherwise null.
vmTraceobject | nullLow-level VM execution trace. Populated only when "vmTrace" is included in traceTypes; otherwise null.

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
-32002tier_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.
-32003rate_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://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 (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.