Skip to content

Trace

Source-less CPI tree + CU profile for any on-chain transaction. Works on every landed Solana transaction without needing the program author's source code.

Venum Trace parses the transaction's log messages into a nested cross-program call graph with per-node compute unit attribution. Use it to understand where CU goes, which programs were called at each CPI depth, and where a failed transaction reverted.

Requires API key.

GET /v1/trace/:signature

Parameters:

  • :signature — Transaction signature (base58, 87-88 characters)

Response:

json
{
  "signature": "5Kx9abc...3nF",
  "slot": 410750000,
  "blockTime": 1729440000,
  "err": null,
  "cu": {
    "consumed": 145234,
    "budget": 200000
  },
  "tree": [
    {
      "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
      "depth": 1,
      "cuConsumed": 145234,
      "cuBudget": 200000,
      "status": "success",
      "children": [
        {
          "programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc",
          "depth": 2,
          "cuConsumed": 89014,
          "cuBudget": 196987,
          "status": "success",
          "children": []
        }
      ]
    }
  ],
  "programs": [
    { "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", "totalCu": 145234, "invocations": 1 },
    { "programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc", "totalCu": 89014, "invocations": 1 }
  ],
  "cached": false,
  "fetchedAt": 1729440012345
}

Response (not found):

json
{
  "error": "Transaction not found",
  "signature": "5Kx9abc...3nF",
  "hint": "Transaction may still be processing, or the signature may be invalid."
}

Fields

Top level

FieldDescription
signatureTransaction signature echoed back
slotSlot the transaction landed in
blockTimeBlock time as Unix seconds (null if unavailable)
errExecution error, or null if the transaction succeeded
cu.consumedTotal compute units consumed by the transaction
cu.budgetCompute budget set for the top-level invocation
treeNested cross-program call graph (see below)
programsFlat list of every program invoked, sorted by totalCu descending
cachedtrue if the response was served from cache
fetchedAtServer timestamp (ms) when the response was first computed

Tree node

FieldDescription
programIdProgram that was invoked
depthCPI depth (1 = top-level instruction)
cuConsumedCU consumed by this invocation (includes CU spent by all children)
cuBudgetCU budget available to this invocation
statussuccess or failed
errorError message if status === "failed"
childrenNested invocations performed via CPI from this program

Program summary

FieldDescription
programIdProgram address
totalCuSum of CU consumed across every invocation of this program in the transaction
invocationsNumber of times the program was invoked

How it works

The endpoint calls getTransaction on the RPC node once, then parses the resulting meta.logMessages for the standard Solana validator markers:

  • Program <id> invoke [<depth>] — pushes a new node onto the call graph
  • Program <id> consumed <x> of <y> compute units — attributes CU to the matching open invocation
  • Program <id> success / Program <id> failed: <err> — closes the invocation

Because transaction data is immutable once landed, responses are cached server-side and repeat queries pay no RPC cost.

Rate limits

TierTraces / minute
AnonymousBlocked
Free5
Starter30
Pro150
InternalUnlimited

See Authentication for API key setup.

Usage

curl

bash
curl -H "x-api-key: $VENUM_API_KEY" \
  https://api.venum.dev/v1/trace/5Kx9abc...3nF

CLI

bash
venum trace 5Kx9abc...3nF
venum trace 5Kx9abc...3nF --json

TypeScript

typescript
const resp = await fetch(`https://api.venum.dev/v1/trace/${signature}`, {
  headers: { 'x-api-key': process.env.VENUM_API_KEY! },
});
const trace = await resp.json();

console.log(`Total CU: ${trace.cu.consumed} / ${trace.cu.budget}`);
for (const p of trace.programs) {
  console.log(`  ${p.programId}: ${p.totalCu} CU (${p.invocations}x)`);
}

Notes

  • Trace only reads landed transactions. Pending or unknown signatures return 404.
  • Program names, instruction names, and internal function names are not returned by this endpoint — only program IDs, CPI structure, and CU attribution. Symbol-level enrichment (Anchor IDL, PC-offset disassembly) lands in paid tiers.
  • The endpoint is read-only and safe to call frequently; repeat calls on the same signature hit cache.