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:
{
"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):
{
"error": "Transaction not found",
"signature": "5Kx9abc...3nF",
"hint": "Transaction may still be processing, or the signature may be invalid."
}Fields
Top level
| Field | Description |
|---|---|
signature | Transaction signature echoed back |
slot | Slot the transaction landed in |
blockTime | Block time as Unix seconds (null if unavailable) |
err | Execution error, or null if the transaction succeeded |
cu.consumed | Total compute units consumed by the transaction |
cu.budget | Compute budget set for the top-level invocation |
tree | Nested cross-program call graph (see below) |
programs | Flat list of every program invoked, sorted by totalCu descending |
cached | true if the response was served from cache |
fetchedAt | Server timestamp (ms) when the response was first computed |
Tree node
| Field | Description |
|---|---|
programId | Program that was invoked |
depth | CPI depth (1 = top-level instruction) |
cuConsumed | CU consumed by this invocation (includes CU spent by all children) |
cuBudget | CU budget available to this invocation |
status | success or failed |
error | Error message if status === "failed" |
children | Nested invocations performed via CPI from this program |
Program summary
| Field | Description |
|---|---|
programId | Program address |
totalCu | Sum of CU consumed across every invocation of this program in the transaction |
invocations | Number 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 graphProgram <id> consumed <x> of <y> compute units— attributes CU to the matching open invocationProgram <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
| Tier | Traces / minute |
|---|---|
| Anonymous | Blocked |
| Free | 5 |
| Starter | 30 |
| Pro | 150 |
| Internal | Unlimited |
See Authentication for API key setup.
Usage
curl
curl -H "x-api-key: $VENUM_API_KEY" \
https://api.venum.dev/v1/trace/5Kx9abc...3nFCLI
venum trace 5Kx9abc...3nF
venum trace 5Kx9abc...3nF --jsonTypeScript
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.
