Why Auditing Swaps on Solana Is So Difficult, But Possible

DeFiSolana

Nov 21, 2025

8 minute read

Why Auditing Swaps on Solana Is So Difficult, But Possible

(and Why Accurate Financial Reporting Depends on Deep Transaction Parsing)

Blockchain transactions are often described as “transparent,” but anyone who has attempted to audit a Solana transaction knows the truth: transparency does not equal clarity.

A swap, exchanging Token A for Token B, seems simple enough on paper. Yet the moment you dig into an actual Solana transaction, what initially appears to be a straightforward exchange becomes a branching maze of account creations, wrapped assets, rent transfers, cleanup operations, and protocol-specific nuances.

Whether the person reviewing the transaction is a retail user, a CFO, a fund accountant, an audit team from a big accounting firm, or even an IRS examiner, they all face the same core question:

“What exactly happened here?”

Answering that reliably is far from trivial.

At NODE40, we focus on ensuring that financial reporting aligns precisely with blockchain reality. This post provides a progressively more complex tour of how Solana swaps work, and why accurate auditing requires more than looking at token deltas or wallet balance changes.

The Simplest Case: SPL Token A Swapped for SPL Token B

(Example 1: USDC swapped for PYUSD)

At the most basic level, a user supplies one SPL token (e.g., USDC) to a swap aggregator like Jupiter and receives another SPL token (e.g., PYUSD). For this example, we assume the PDA (Program Derived Account) for PYUSD already exists. The transaction contains three essential parts:

  1. The input token (USDC) transferred into Jupiter
  2. The output token (PYUSD) transferred back to the user
  3. A small amount of SOL paid as the transaction fee

From an auditing standpoint, this scenario is relatively straightforward:

  • Both tokens already exist as SPL accounts.
  • No accounts need to be created or closed.
  • The number of instructions related to the swap is small.
  • The amount sent and the amount received are easily identifiable within the transaction.

Just about any ledger or tax engine can usually categorize this cleanly as:

USDC disposed. PYUSD acquired. Plus a negligible SOL fee.

But this is where simplicity ends because, while a real example, it is far less common than you might hope.

Complexity Emerges: Swapping SOL for an SPL Token

(Example 2: SOL swapped for USDC)

When the user swaps SOL, the rules change. SOL is not an SPL token, so before it can be used in an SPL-based swap protocol, it must be converted to Wrapped SOL (WSOL), which is an SPL token.

Figure 1: Solscan view of a SOL/USDC swap.

This conversion introduces a cascade of additional steps that occur inside a single Solana transaction.

What actually happens under the hood:

  1. A new WSOL account is created
    • Rent is deposited (0.00203928 SOL for an SPL account).
    • Value will be transferred from this new account into Jupiter and not from the original wallet account.
Figure 2: Solscan view of the WSOL account creation instruction set.
  1. SOL is deposited into the WSOL account as the intended swap input.
Figure 3: Solscan view of the WSOL account seeded with 8 SOL and conversion to WSOL.

The new current balance of the WSOL PDA is 8.00203928, more than the intended swap.

  1. The WSOL is transferred to the swap program (e.g., Jupiter route). Jupiter will route the WSOL to one or more swap protocols to find the best rate.
  2. The WSOL account is closed after the swap.
  3. The rent deposit is returned to the user.
Figure 4: Solscan view of the WSOL account closed and return of the previously deposited rent.

Financial Intent

The user intended to “swap SOL for USDC,” but internally, this looks like:

  • Account creation
  • Rent payments
  • Multiple transfers
  • Cleanup instructions
  • Token conversions

From an audit perspective, it now takes far more than balance differences to correctly classify what happened.

Intent is important here because when viewing this transaction on Solscan, it appears WSOL is swapped for USDC, but that is misleading and can easily trip up an auditor because of the flash conversion of SOL/WSOL and back again, all within the same atomic operation set in the transaction.

Why This Becomes Hard for Auditors (and Software)

1. Multiple Possible Account Creation Methods

On Solana, an SPL token account can be created through several different instructions:

  • createAccount
  • createAccountWithSeed
  • Associated Token Account (ATA) creation
  • Program-derived account initializations from within the swap route itself

An auditor must recognize all variants. Missing even one path means misclassifying a transaction or worse, misunderstanding a transaction.

2. Multiple Transfer Instruction Types

Transfers can be performed using:

  • transfer
  • transferChecked

And the amount being transferred is stored in different locations depending on which instruction is used.

If your parser expects one format, but the protocol uses the other, your interpretation of the swap becomes incorrect, even though the transaction succeeded on-chain.

3. Output Token Account Might Not Exist Yet

If the user has never received the output token before (USDC, PYUSD, BONK, etc.), the swap transaction must first create the token account for that asset.

This means:

  • A new token account is created
  • Rent is deposited into that account
  • Only then can the output SPL token be deposited

Because of this, the net SOL change in the transaction includes:

  • Transaction fee
  • Rent for the new output token account
  • SOL to WSOL wrapping
  • WSOL account rent
  • WSOL account closure refund

Which leads to one of the most important lessons in Solana auditing:

You cannot determine a swap’s input and output amounts by looking at net balance changes alone.

Balance deltas only show net change, not causal change.

To determine what was actually swapped, you must inspect:

  • Individual instructions
  • Specific fields inside parsed SPL token operations
  • Account creation events
  • Wrap/unwrap patterns

NODE40’s system was designed from the ground up to resolve these ambiguities. Block explorers are too limited to be relied on exclusively. In the example we just talked about, Solscan showed a WSOL/ USDC swap, but we know this is incomplete. In reality, it was a SOL/USDC swap with some interesting stuff along the way.

When Swaps Are Only One Part of the Story

(Multi-Action Transactions: Swap + Collateralization + Borrowing)

Solana’s composability enables multiple operations inside a single transaction that are generally treated as distinct events in finance.

A real-world example might look like:

  1. Swap Token A for Token B
  2. Deposit Token B into a lending protocol as collateral
  3. Borrow Token C against that collateral

From a user’s perspective, this is a sequence of actions with distinct financial consequences:

  • A token disposal and acquisition
  • A collateral deposit (asset still owned but encumbered)
  • A loan origination (taxable in some jurisdictions)

From the blockchain’s perspective, it is one atomic transaction containing dozens of instructions.

From an auditor’s perspective, things become extremely complicated:

  • The swap cannot be deduced from net token changes because subsequent steps modify balances.
  • The collateral deposit may show as a token outflow but is not a disposal.
  • The loan appears as an inflow but is not income.

Only by parsing the transaction instruction-by-instruction can you accurately isolate:

  • Swap input
  • Swap output
  • Protocol deposits
  • Protocol withdrawals
  • Fee payments
  • Account creations
  • Cleanup instructions

This is the only way to ensure accurate accounting treatments and a correct audit trail.

Why Full Transaction Parsing Is Non-Negotiable for Accurate Reporting

The deeper one goes into Solana transactions, the clearer the truth becomes: Balance changes tell you what changed. They do not tell you why it changed.

Understanding the “why” requires:

  • Identifying protocol-specific instructions
  • Parsing nested inner instructions
  • Tracking WSOL wrapping patterns
  • Classifying account creations and closures
  • Distinguishing rent from actual economic activity
  • Following tokens across program boundaries
  • Resolving token standards, decimals, and conversions

At NODE40, we have built native, protocol-aware parsing to surface each component of a Solana transaction as its own auditor-friendly data layer and support is expanding every day. This includes:

  • Swap in/out amounts
  • WSOL wrapping/unwrapping
  • Rent deposits and refunds
  • Account creations
  • Collateral movements
  • Loan originations and repayments
  • Liquidations
  • Rewards and fee extractions

The end result is a complete, human-interpretable reconstruction of what actually happened, no matter how complex the transaction.

Auditing a Solana swap is not simply a matter of recording “token A out, token B in.”

Even the simplest swaps contain layers of hidden behavior, and moderate or advanced transactions can involve dozens of interconnected steps.

If your financial reporting depends on accurate classification, whether you’re an accountant, an auditor, or a regulator, full transaction parsing is essential.

NODE40’s platform was engineered to give professionals the clarity they need by reconstructing every transaction into clear, verifiable, audit-ready components.

If you want to understand what actually happened inside your Solana transactions, you need more than token deltas—you need a system that speaks Solana’s language.

You may also like

Stay One Step Ahead

Find the latest news, tips and insights about how to manage crypto taxes, monitor digital assets and track performance more efficiently.

We care about protection of your data, Read our Privacy Policy