[Supanode](https://supanode.xyz/)[Learn](https://supanode.xyz/learn)Find SPL token balances beyond the wallet SOL balance

# Find SPL token balances beyond the wallet SOL balance

Read token accounts for the correct mint and token program, then normalize raw amounts.

**On this page**[SOL and SPL balances live in different accounts](https://supanode.xyz/learn/solana-token-balance-missing#sol-and-spl-balances-live-in-different-accounts)[Query by owner and program](https://supanode.xyz/learn/solana-token-balance-missing#query-by-owner-and-program)[Reconcile the displayed balance](https://supanode.xyz/learn/solana-token-balance-missing#reconcile-the-displayed-balance)[Handle extensions deliberately](https://supanode.xyz/learn/solana-token-balance-missing#handle-extensions-deliberately)[Sources](https://supanode.xyz/learn/solana-token-balance-missing#sources)

## SOL and SPL balances live in different accounts

`getBalance` returns an account's lamport balance. An SPL token balance is stored in a token account associated with a mint and an owner authority. One wallet can control several token accounts for one mint, so an associated token account alone is not necessarily the whole balance.

## Query by owner and program

```
{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner","params":["WALLET",{"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"encoding":"jsonParsed","commitment":"confirmed"}]}
```

This example addresses the original Token Program. Query Token-2022 separately when it is relevant. A mint belongs to a particular token program; choose your decoder and associated-account derivation accordingly.

## Reconcile the displayed balance

1.  Verify cluster, wallet and mint addresses. Similar token symbols do not identify the same asset.
2.  Collect all matching token accounts and inspect their raw amounts.
3.  Sum raw integer amounts for the same mint, then apply that mint's decimals. Avoid binary floating-point for accounting.
4.  If an expected account is absent, inspect its creation or closure history and the transaction that changed it.

## Handle extensions deliberately

Token-2022 extensions can alter transfer behavior and available balances. A parsed raw balance is not automatically the amount immediately spendable through every transfer path. For a portfolio interface, show the asset mint and distinguish balance retrieval errors from a verified zero. For a payment system, reconcile the exact destination token account and mint, rather than crediting any incoming asset with a familiar ticker.

## Sources

-   [Solana: getBalance](https://solana.com/docs/rpc/http/getbalance)
-   [Solana: getTokenAccountsByOwner](https://solana.com/docs/rpc/http/gettokenaccountsbyowner)
-   [Solana token accounts](https://solana.com/docs/tokens/basics/create-token-account)

## Continue reading

[Solana streaming guide](https://supanode.xyz/blog/solana-data-streaming-guide)[Solana product Docs](https://supanode.xyz/docs/solana/quickstart)[Learn library](https://supanode.xyz/learn)

---
Source: https://supanode.xyz/learn/solana-token-balance-missing
