Solana transaction literacy · Mainnet product plan
Solana Top-Level vs Inner Instructions: How to Read a Trade Trace
By AudaceFi · Updated
This guide describes planned mainnet features. It does not confirm that they are available today.
For this guide's planned AudaceFi mainnet scope, build a trace record you can explain: which accounts are resolved, which inner instructions are supplied and which details remain unknown.
What the two instruction layers establish
Top-level instructions are the outer entries in a Solana transaction trace. Inner instructions come from cross-program invocations (CPIs). When supplied as encoded data, their entries appear in transaction metadata. Read them as different layers of the same trace, rather than interchangeable instruction lists.
A getTransaction response containing indexed accounts and encoded instruction data is not yet a resolved instruction list. Transaction-introspection tooling can resolve indexed accounts and normalize inner entries into an outer-then-inner explorer view. Use that view to understand the trace's structure. Do not infer economic purpose from an instruction name alone.
Sources: 1
A fictional trace from indices to readable labels
The following schematic is fictional. Assume a versioned transaction with inner metadata available, containing one outer instruction and an associated inner CPI instruction. It is not an RPC payload. Address labels stand for addresses, and data labels stand for encoded content.
Use this assumed mapping: index 2 resolves to STATIC_A from static account keys, and index 5 resolves to LOOKUP_B from an Address Lookup Table (ALT). Versioned transactions draw accounts from static keys and ALT-loaded addresses. These labels are not valid addresses. This mapping is not a specification of ALT index ordering.
In the views below, resolving references changes the account labels, while normalizing the inner entry makes its relationship to the outer entry readable. The encoded data placeholders remain uninterpreted. Treat the ordering as an explorer-style presentation, not a complete nested execution history.
- Before: Outer A uses [2, 5] with OUTER_DATA_ENCODED. Its associated Inner A.1 uses [5] with INNER_DATA_ENCODED.
- After: Outer A uses [STATIC_A, LOOKUP_B] with OUTER_DATA_ENCODED, followed by Inner A.1 using [LOOKUP_B] with INNER_DATA_ENCODED.
Sources: 1
Check what is resolved before describing the trade
Take a transaction response you are already reviewing and annotate each instruction with its label, outer or supplied-inner classification, original account indices, resolved addresses or an unresolved marker, and remaining encoded data. Apply these checks before describing what the trade did.
- If an account reference is still numeric, keep it unresolved until you have an explicit address mapping. For a versioned transaction, document whether that mapping uses static keys or ALT-loaded addresses.
- If inner CPI entries are supplied, distinguish them from outer entries and preserve the outer-then-inner display. If the inner view is unavailable, mark it unknown. Do not conclude that no CPIs occurred.
- If instruction data remains encoded, record that limitation beside the resolved addresses. Keep readable account references separate from instruction data that still needs interpretation.
Sources: 1
Sources and scope
This guide describes the planned AudaceFi mainnet product. The Rulebook and current product availability govern participation.