Solana Token Accounts: Why Watching an Agent's Address Can Miss Its USDC
GetAgentCap team · published 9/29/2026
On Solana, an agent's USDC is not held at the address you gave us. It sits in one or more token accounts that the address owns. If your tracker only watches the owner address, some of the spend can go missing without any error.
Owner address versus token account
A Solana wallet address (the owner) holds SOL directly. SPL tokens such as USDC are held in separate token accounts. Each token account records a mint, an owner and a balance.
A USDC transfer moves tokens from one token account to another. The owner's address signs the transaction, but the balance change is recorded against the token account, not the owner.
Associated token accounts are the common case, not the only case
Most wallets use the Associated Token Account (ATA). Its address is derived deterministically from three inputs: the owner, the token program and the mint. For USDC the mint is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.
An owner can also hold extra token accounts for the same mint that are not the ATA. Some programs and older tooling create these. A tracker that only derives the ATA will miss any spend that flows through them.
The token program is part of the derivation
The original SPL Token program and Token-2022 are separate programs with different program IDs. The ATA for a given mint depends on which program that mint belongs to.
Using the wrong program ID gives you a valid-looking address with no history. Reading the mint account tells you which program owns it. Do that check rather than hardcoding one program.
How to enumerate what an owner actually holds
The RPC method getTokenAccountsByOwner, filtered by mint or by program ID, returns every token account the owner controls, not just the ATA. Run it for both token programs.
Then read the signature history of each token account, not only of the owner. A transfer between two token accounts may not include the owner in the way a naive signature query expects.
Reading a transfer correctly
Transaction metadata includes preTokenBalances and postTokenBalances. Each entry has an account index, a mint, an owner and a UI amount. Compare them per token account to get the exact USDC delta.
Group those deltas by the owner field to attribute spend to an agent. Grouping by the token account address alone can split one agent's spend across several rows.
Closed and recreated accounts
A token account can be closed, which returns its rent-exempt SOL deposit, and later recreated at the same ATA address. The history spans both lifetimes.
The SOL returned on closure is a rent refund, not a payment. Recreating the account costs a new rent deposit. Book both as overhead, separate from USDC spend.
What this means for a public-address tracker
You can track all of this read-only from the owner address. No keys are needed because account ownership and balances are public state.
The rule to follow: treat the owner address as the identity, discover its token accounts under both programs, and reconcile from token-balance deltas instead of from transaction counts.