Balances

The balances table contains all changes in the balances of assets across all Ethereum wallets.

This includes Native Ether, ERC20, ERC721 and ERC1155 tokens. Includes USD value where applicable. Token-specific balance tables are available for query.

For balances tables can be used to easily plot the change in the balance of an address or a group of addresses over time.

Sample Query

Getting the ETH Balances across bridges on Ethereum

select 
    date,
    project,
    sum(balance) as eth
from ( -- Find last balance entry for each bridge address weekly
select
    date_trunc('week', block_timestamp) as date, 
    project,
    balances.address,
    balance
from ethereum.assets.balances balances
inner join common.identity.entities on balances.address = entities.address and category = 'bridge' and chain = 'ethereum'
where block_timestamp > '2021-05-01' and token_type = 'ETH'
qualify row_number() over (partition by balances.address, date order by block_timestamp desc) = 1
)
group by 1,2

Table Columns

Column NameDescriptionExample

address

Address of the account.

0xd387a6e4e84a6c86bd90c158c6028a58cc8ac459

token_address

Token address of the asset.

Note: Native ETH does not have a contract address, but for convention, it is labelled as: 0x0000000000000000000000000000000000000000

0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

token_name

Name of the token.

USD Coin

token_symbol

Token symbol of the token.

USDC

token_id

Unique token ID of the asset. Only applicable for ERC721 and ERC1155 tokens.

raw_balance

Balance of tokens (unnormalized)

10000000

balance

Balance of this ERC20 token, normalized by the decimal points defined in the ERC20 token contract. For example, USDC has 6 decimals, so this value is the raw_balance divided by 10^6.

10

usd_balance

The amount of tokens, in $USD.

10

usd_exchange_rate

The exchange rate used to calculate the usd_value.

1

block_timestamp

The timestamp of the block that that resulted in the balance.

2022-09-15 13:51:47

block_number

The number of the block that resulted in the balance.

15539508

block_hash

The hash of the block that resulted in the balance.

0x25680259dfb40b4ee724ae22fda01a34e6d598c5f2fc25b6d871cb56c488de70

token_type

Token type of asset. Includes ETH, ERC20, ERC721 and ERC1155.

ERC20

Last updated