> ## 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

Sample query:

```sql theme={null}
select * from bitcoin.assets.balances
where block_timestamp >= current_timestamp - interval '5 hours';
```

Table Columns

### Table Details

| Property            | Value                                |
| ------------------- | ------------------------------------ |
| Table Name          | `bitcoin.assets.balances`            |
| Table Status        | Production-Ready                     |
| Unique Key          | `block_timestamp::date`, `unique_id` |
| Clustering Key(s)   | `block_timestamp::date`              |
| Search Optimization | `address`, `block_number`            |

### Table Columns

| Column Name         | Data Type         | Description                                                                                                 |
| ------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------- |
| address             | VARCHAR(130)      | Address of the account.                                                                                     |
| raw\_balance        | FLOAT             | Balance of tokens (unnormalized)                                                                            |
| raw\_balance\_str   | VARCHAR(16777216) | String of balance of tokens                                                                                 |
| balance\_str        | VARCHAR(16777216) | Balance of this token, normalized by the decimal points defined in the token contract.                      |
| balance             | FLOAT             | Balance of the token, normalized by the decimal points defined by BTC protocol in sats. One sat = 1e-8 btc  |
| usd\_balance        | FLOAT             | The amount of tokens, in \$USD at the current time.                                                         |
| usd\_exchange\_rate | FLOAT             | The exchange rate used to calculate the usd\_value at current time.                                         |
| block\_timestamp    | TIMESTAMP\_NTZ(9) | The timestamp of the block that that resulted in change in balance.                                         |
| block\_number       | NUMBER(38,0)      | The number of the block that resulted in change in balance.                                                 |
| block\_hash         | VARCHAR(66)       | The hash of block that resulted in change in balance.                                                       |
| transaction\_hash   | VARCHAR(66)       | Hash of the transaction that produced this record. Uniquely identifies a transaction within the blockchain. |
| transaction\_index  | NUMBER(38,0)      | Zero-based position of the transaction within its block. The first transaction in a block has index 0.      |
| unique\_id          | VARCHAR(16777216) | Unique ID of the balances entry                                                                             |
| \_created\_at       | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was created in the database.                                                    |
| \_updated\_at       | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was last updated in the database.                                               |
