Solana Pre and Post Balances for Token Changes
Interpret Solana pre- and post-token balances with account indexes, mint identity and missing-side handling, without inventing a zero-valued historical account.

Overview
When translating these concepts into an integration, keep the scope described by the historical balance api with the result. The examples in historical token balances and blockchain data reconciliation show how the same distinction affects neighbouring data questions.
Transaction balance metadata can help explain state changes. The before and after sides must be matched by account identity and token context, not simply by their positions in separate arrays.
Map indexes to account identities
Resolve account indexes against the transaction’s complete account-key context, including versioned-message details where applicable. Keep mint, owner when available and raw amount scale. An absent pre or post entry can reflect account creation, closure or metadata availability; it should not be treated as an unconditional numeric zero without interpretation.
Worked example: a newly created account
A transaction creates a token account and ends with five units. The pre side has no corresponding account entry. An interpreter can classify the lifecycle and derive a relevant increase when the evidence supports it, but should retain the absent pre observation rather than pretend the account was queried earlier with a zero balance.
Keep changes separate from action labels
A balance delta can result from several instructions in one transaction. Preserve instruction and event evidence before calling it a purchase, reward or payment. Test multiple accounts for one mint, missing owner metadata and changed decimal interpretation. Retain the raw transaction metadata so a later parser can reproduce or correct the derived changes.
A practical acceptance test
Provide pre and post arrays in different display orders, including one new account with no pre entry. Match by documented account indexes and context, preserving absence explicitly. Add an unsupported transaction version and verify partial interpretation rather than a guessed zero change. A derived action label must link to the balance and instruction evidence it used.
Questions about the topic
Frequently asked questions
Can arrays be matched by display order alone?
No. Use the documented account indexes and transaction context.
Does a balance increase prove a purchase?
No. It establishes a change, not its full economic meaning.
Standards & technical documentation
