Skip to main content

Blockchain Coverage

We support balances data for the following blockchains:
BlockchainBalances Model
BitcoinThe bitcoin.assets.balances contains Bitcoin balance-block changes in balances. Refer to here for more details.
SolanaThe solana.assets.balances contains Solana SOL and SPL token balances models. Refer to here for more details.
SuiThe sui.raw.balance_changesBalance changes track the alterations in the amount of assets held by accounts, caused by transactions on Sui. Refer to here for more details.
EVM-Compatible BlockchainsThe crosschain.assets.fungible_balances_evm model offers a historical record of fungible asset balances, including native gas tokens and ERC-20 compatible tokens.

EVM-Compatible Blockchains

The crosschain.assets.fungible_balances_evm model offers a historical record of fungible asset balances, including native gas tokens and ERC-20 compatible tokens. Each entry in the model corresponds to a specific event/transaction that causes a balance change in a particular asset at the block level. This means a new data entry is only created when a transaction alters an asset’s balance at the block level.
  • For example, if a wallet receives 1 ETH in 2015 and experiences no further changes until yesterday, the model will have two entries: one for the initial receipt in 2015 and another for the recent change

Blockchain Coverage

We support fungible balance data (erc20 & native token) for the following EVM-compatible blockchains:
arbitrum, avalanche, base, berachain, bsc, ethereum, linea, optimism, polygon, unichain, worldchain

Sample Query

This query generates daily balances from block-level balances data.
  • Replace the address with the desired wallet address, in lowercasing.
  • Replace the chain with the desired blockchain.
with
    balance_change_daily as (
        select 
        date(block_timestamp) as block_date, 
        row_number() over (partition by date(block_timestamp), chain, address, token_address order by block_number desc) as rn,
        *
        from crosschain.assets.fungible_balances_evm
        where address = lower('') and chain in ('ethereum', 'bsc', 'base')
    ),
    changed_balances as (
        select
            *,
            lead(block_date) over (
                partition by chain, token_address, address order by block_date asc
            ) as next_update_day
        from balance_change_daily
        where rn = 1
    ),
    forward_fill as (
        select cast(d.date_timestamp as timestamp) as day, *
        from common.utility.dates d
            left join
                changed_balances b
                on d.date_timestamp >= b.block_date
                and (b.next_update_day is null or d.date_timestamp < b.next_update_day)
            where date_timestamp <= current_date and date_timestamp >= '2015-01-01'
    )
select
    f.day::timestamp_ntz(9) as block_date,
    f.chain::varchar as chain,
    f.address::varchar as address,
    f.token_address::varchar as token_address,
    ft.name::varchar as token_name,
    ft.symbol::varchar as token_symbol,
    ft.decimals::bigint as token_decimals,
    f.raw_balance_str::varchar as raw_balance,
    coalesce(f.balance_str::float, div0(f.raw_balance_str, power(10, ft.decimals)::float)) as balance,
    (f.balance * hp.price)::float as usd_balance,
    hp.price::float as usd_exchange_rate,
    f.block_timestamp::timestamp_ntz(9) as last_activity_block_timestamp,
    f.block_number::bigint as last_activity_block_number,
    f.block_hash::varchar as last_activity_block_hash,
from forward_fill f
left join crosschain.raw.fungible_tokens ft on f.chain = ft.chain and f.token_address = ft.address
left join common.prices.hourly hp on f.block_date = hp.timestamp and f.token_address = hp.address and hp.chain = f.chain
where 1=1 
  and raw_balance_str > '0'  -- [Optional]  Exclude non-zero balances
  and usd_exchange_rate is not null -- [Optional] Exclude fungible balances without prices data
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 tokens or balances above a certain USD value.

Table Column

Unique Key: unique_id
Column NameDescription
chainThe EVM-compatible blockchain of where the assets are held.
addressThe wallet address holding the token.
token_addressThe contract address of the token. Native tokens are represented with zero address.
token_nameThe name of the token.
token_symbolThe symbol of the token.
raw_balance_strThe raw balance as a string to retain precision.
raw_balanceThe raw balance as a numeric value.
balance_strThe formatted balance as a string to retain precision.
balanceThe formatted balance as a numeric value.
usd_balanceThe balance converted to USD.
usd_exchange_rateThe exchange rate used for USD conversion.
block_timestampThe timestamp of the block containing the balance.
block_numberThe block number containing the balance.
block_hashThe hash of the block containing the balance.
unique_idA unique identifier for the balance record.
_updated_atThe timestamp of the last update to the balance record.
I