> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Balances

The Solana.assets.balances table contains the full-history of SOL and SPL-TOKEN balances for all Solana addresse. A row is added only when a balance change occurs due to a transaction performed by the user or to the user.

### Table Details

| Property | Value |
| - | - |
| Table Name | `solana.assets.balances` |
| Table Status | Production-Ready |
| Unique Key | `block_timestamp`, `txn_id`, `unique_id` |

The Solana.assets.balances table contains the full-history of SOL and SPL-TOKEN balances for all Solana addresses. A row is added only when a balance change occurs due to a transaction performed by the user or to the user.

## Solana Balances

The `solana.assets.balances` table provides transaction-level SOL and SPL token balances of all Solana accounts. Each row corresponds to a change in the balance of SOL / SPL tokens caused by the transaction.
Note that 0 balance changes are not present in this table.

> [!NOTE]
>
> **Why some addresses appear in `transfers` but not in `balances`:**
> Balance records are extracted at the transaction level from RPC-reported balance changes. If an address's SOL movements within a transaction are transient (e.g. SOL passed through to fund a token account) and the net balance change is zero, the RPC does not report a balance change — so no row appears in this table.
>
> These movements still appear in [`solana.assets.transfers`](https://docs.allium.so/historical-data/supported-blockchains/solana/solana/assets/transfers) because transfers capture individual instruction-level activity, including token account funding.

> [!NOTE]
>
> Both `sol_balances` and `spl_token_balances` are huge tables. It is advised that you query time ranges and specific addresses
>
> * spl\_token\_balances \~ 15bil rows
> * sol\_balances \~ 330bil rows

> [!NOTE]
>
> A daily end-of-day balances snapshot model is now available at [Daily Balances](https://docs.allium.so/historical-data/supported-blockchains/solana/solana/assets/daily-balances.md)

## Sample Query

> [accordion] Generate Daily Balances from tx-level balances data
>
> This query generates daily end-of-day balances from txn-level balances data.
>
> * Replace the address with the desired wallet address.
>
> ```sql theme={null}
>   select * from
>   table(solana.udfs.sql_table_solana_get_daily_balances(
>       array_construct('...'),
>       '2025-07-09'::timestampntz,
>       '2025-07-10'::timestampntz
>       )
>   )
> ```
>
> **Note**: the final output will contain all tokens held by the wallet, including undesirable spam tokens.
> One approach to counter this would be to filter the output of the query with the desired token mints or balances above a certain USD value.

## Solana Balances Latest

The `solana.assets.balances_latest` table provides a snapshot of SPL and SOL tokens' most recent balance information.

### Table Columns

| Column Name | Data Type | Description |
| - | - | - |
| token\_type | VARCHAR(9) | Type of token (SOL or SPL-TOKEN) |
| address | VARCHAR(16777216) | Address of the token holder |
| token\_account | VARCHAR(16777216) | Token account associated with the token holder |
| decimals | NUMBER(38,0) | Number of decimal places |
| mint | VARCHAR(16777216) | Mint address of the token |
| symbol | VARCHAR(16777216) | Ticker symbol of this token or asset. Short alias for `token_symbol` used in tables that preserve the original blockchain field naming convention. |
| program\_id | VARCHAR(16777216) | Program id associated with the token |
| raw\_balance\_str | VARCHAR(16777216) | Raw balance of the token as a string for precision. |
| raw\_balance | FLOAT | Raw balance of the token |
| balance\_str | VARCHAR(16777216) | Balance of the token in string format for precision. |
| balance | FLOAT | Balance of the token. |
| usd\_balance | FLOAT | USD balance at the block timestamp. |
| usd\_exchange\_rate | FLOAT | USD value of the balance at the block timestamp. |
| signer | VARCHAR(16777216) | Transaction Signer. |
| success | BOOLEAN | Boolean indicator whether this transaction suceeded. |
| is\_voting | BOOLEAN | Boolean indicator whether this is a voting transaction. |
| block\_slot | NUMBER(38,0) | Block slot of the transaction that resulted in the balance change. |
| block\_height | NUMBER(38,0) | Block height of the transaction that resulted in the balance change. |
| block\_hash | VARCHAR(16777216) | Block hash of the transaction that resulted in the balance change. |
| block\_timestamp | TIMESTAMP\_NTZ(9) | Block timestamp of the transaction that resulted in the balance change. |
| txn\_id | VARCHAR(16777216) | Transaction ID that resulted in the balance change. |
| txn\_index | NUMBER(38,0) | Transaction index of the transaction id. |
| unique\_id | VARCHAR(16777216) | Unique id assigned to the balances entry. |
| \_updated\_at | TIMESTAMP\_NTZ(9) | updated timestamp |
