How to Read Solscan Nested Instructions: Tracing from Top-Level to CPI Calls

 / 
1

The core of viewing nested instructions is to look at the "Inner Instructions" on the Sol scan transaction details page. It fully expands a transaction's complete call tree from top-level instructions to CPI (cross-program invocations), clearly listing who called whom, what parameters were passed, and how many tokens were transferred at each step.

1. Understand Solana's Instruction Structure: It's Not a Single Transfer, It's a Tree

A Solana transaction can contain multiple top-level instructions. Each top-level instruction, during execution, can call another program (CPI), and that program can call yet another program.

Solscan's Inner Instructions essentially "flatten" this tree for you to see. It arranges the top-level instruction and all CPI calls it triggers in execution order, using indentation (or a hierarchical table) to show which program called which.

Prerequisite: You have a Solana transaction hash (TxHash). Open Solscan and paste the hash.

2. Practical Walkthrough: Tracing from the Main Instruction All the Way to CPI

Step 1: Locate the "Instructions" Section

  • What to do: Find the "Instructions" panel on the Solscan transaction details page. This is the new layout after the November 2025 upgrade; instruction details may be collapsed by default, requiring manual expansion.

  • How to do it: Scroll down and locate the "Instruction" or "Instructions" header. If you see a bunch of collapsed gray bars, click "Expand All" or expand them one by one.

  • When you're done: You see the list of top-level instructions, such as "System Program", "Token Program", "Unknown Program", etc.

Step 2: View the "Inner Instructions" Call of a Top-Level Instruction

  • What to do: Click the top-level instruction you want to inspect to expand its internal call details.

  • How to do it: Once expanded, you'll see two key sections: Instruction Details (the parameters of the instruction itself, such as recipient and amount) and Inner Instructions (which other programs were called during the execution of this instruction).

  • When you're done: You see the list of sub-calls under the top-level instruction—this is the first layer of CPI.

Step 3: Expand Layer by Layer Down to the Bottom

  • What to do: If an Inner Instruction itself calls another program, continue to expand it.

  • How to do it: In the Inner Instructions list, if a particular item's Program field shows not a system-level program (like Token Program, System Program) but an application contract address (such as Raydium's or Jupiter's program ID), and it has a "More Details" or "+ Inner" button, it likely has a further layer of calls. Click to expand.

  • When you're done: You've drilled down to the bottom layer and confirmed which program ultimately executed the operation (e.g., a swap instruction: top-level is Jupiter program, CPI calls Raydium's Token Swap program, and the Token Program completes the transfer).

Step 4: Confirm the Complete Fund Flow and Failure Cause

  • What to do: Use the information in Inner Instructions to confirm what the transaction actually did and at which step it failed.

  • How to do it:

    • Trace funds: Look at the Balance Changes in Inner Instructions. Solscan has merged SOL and token balance changes into one view, clearly showing the balance change for each account before and after each step.

    • Check failure: If the transaction failed, Solana transactions typically fail at a specific Instruction Index. Check the Program Logs within Inner Instructions; the logs will tell you exactly which program and why (e.g., Error Code: 0x1, Insufficient funds) the failure occurred.

  • When you're done: Using the expanded call tree and logs, you've pinpointed the exact failure point (e.g., Instruction #2 → Inner #3 → Program X → Revert).

3. Common Misconceptions and Pro Tips

Misconception: "Top-level instructions are everything"

The meat of a transaction often lies within CPI calls. A swap might have only 2 top-level instructions (validation then execution), but the CPI within the execution instruction can call 5-6 programs to split orders, perform intermediate swaps, merge, etc.

Pro Tip: If viewing the hierarchy on Solscan's web interface is cumbersome, copy the signature and use solana-cpi-lens to see a tree diagram.

Solscan's Inner Instructions are a list view (flat). If the call depth is too deep (e.g., 5-6 levels), it's easy to get lost.

Risk Reminder: Inner Instructions are a record of execution results, not "intent". If a transaction fails, it may partially rollback; some Inner Instructions you see might have been rolled back yet still appear in logs. Always determine whether the transaction ultimately succeeded by checking the Status (Success / Failed) at the top of the page.

After completing the above steps, how do you know you've reached the bottom?

When you open a transaction's "Inner Instructions" and expand all the way, if the last layer's Program is a base System Program or Token Program, and there are no more expandable sub-items (i.e., the stack height no longer increases), you have reached the end of the CPI calls. If the transaction failed, and you found the first log with Error or Revert within the Inner Instructions, you have identified the root cause of the failure.