Skip to main content

Overview

Our balances models are broadly classified the following:
TypeModel NameDescription
Daily<chain>.assets.fungible_balances_dailyDaily balance entry of address & tokens pairs balances.
Latest<chain>.assets.fungible_balances_latestLatest balances of every address & tokens pairs balances.
Granular<chain>.assets.fungible_balances/balancesGranular block/transaction-level changes in the balances of assets & tokens pairs across wallets.

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.
TronThe tron.assets.fungible_balances contains TRX and TRC20 token balances models. 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

We currently support fungible balances for the following evm-compatible blockchains:
BlockchainNetwork
arbitrumMainnet
avalancheMainnet
b3Mainnet
baseMainnet
berachainMainnet
blastMainnet
bscMainnet
coreMainnet
ethereumMainnet
hyperevmMainnet
inkMainnet
lineaMainnet
optimismMainnet
plasmaMainnet
polygonMainnet
scrollMainnet
soneiumMainnet
unichainMainnet
vanaMainnet
worldchainMainnet
x_layerMainnet
monad_testnetTestnet

Daily Balances

Use Cases:
  • Track the portfolio balance of wallet over time
  • Track the number of holders of an asset over time
  • Identify the distribution of assets across wallets over time

Sample Query: Number of USDC Holders holding >100 USDC daily

select
  date,
  count(distinct case when balance > 0 then  address else null end) as total_holders_count,
  count(distinct case when balance > 100 then  address else null end) as holder_100_usdc_count,
from ethereum.assets.fungible_balances_daily
where token_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' -- USDC Token Address
group by all

Sample Query: Portfolio balance of a wallet over time

select
  date,
  count(token_address) as tokens,
  sum(case when token_address = '0x0000000000000000000000000000000000000000' then usd_balance else null end) as native_balance_usd,
  sum(usd_balance) as total_balance_usd
from ethereum.assets.fungible_balances_daily
where address in ('0xe649a394fb16b58ee2e59feb2ea571e7733c812a')
group by all

Latest Balances

Use Cases:
  • Track the latest balance of a group of addresses across different blockchains
  • Track the distribution of a particular token address currently

Sample Query: Portfolio balance of a wallet currently

select
  count(token_address) as tokens,
  sum(case when token_address = '0x0000000000000000000000000000000000000000' then usd_balance_current else null end) as native_balance_usd,
  sum(usd_balance_current) as total_balance_usd
from ethereum.assets.fungible_balances_latest
where address in ('0xe649a394fb16b58ee2e59feb2ea571e7733c812a')
group by all

Balances at Any Timestamp

The sql_table_<chain>_get_balances_at_timestamp function calculates precise token balances for any list of addresses at a specific point in time. It combines the daily balance snapshot with intraday transaction changes using a Base + Delta approach: Final Balance = EOD Snapshot + Sum(Credits - Debits since snapshot) This is useful when daily snapshots are not granular enough and you need balances at a specific hour or minute.

Usage

SELECT * FROM TABLE(<chain>.UDFS.SQL_TABLE_<CHAIN>_GET_BALANCES_AT_TIMESTAMP(
    ARRAY_CONSTRUCT('0xAddress1', '0xAddress2'),
    '2025-06-15 14:30:00'::TIMESTAMP_NTZ
));

Example: Portfolio balance at a specific time

SELECT
  address,
  token_symbol,
  balance,
  usd_balance,
  calculation_method
FROM TABLE(ETHEREUM.UDFS.SQL_TABLE_ETHEREUM_GET_BALANCES_AT_TIMESTAMP(
    ARRAY_CONSTRUCT('0xe649a394fb16b58ee2e59feb2ea571e7733c812a'),
    '2025-06-15 14:30:00'::TIMESTAMP_NTZ
))
WHERE balance > 0
ORDER BY usd_balance DESC NULLS LAST;

Return Columns

ColumnTypeDescription
addressVARCHARWallet address
token_addressVARCHARToken contract address
token_nameVARCHARToken name
token_symbolVARCHARToken symbol
token_decimalsNUMBERToken decimal places
raw_balance_strVARCHARRaw balance as string (precision-safe)
raw_balanceFLOATRaw balance as float
balance_strVARCHARDecimal-adjusted balance as string
balanceFLOATDecimal-adjusted balance
usd_exchange_rateFLOATUSD price at snapshot time
usd_balanceFLOATBalance in USD
last_activity_block_timestampTIMESTAMP_NTZTimestamp of last activity
last_activity_block_numberNUMBERBlock number of last activity
base_dateDATEDate of the EOD snapshot used
intraday_adjustments_appliedBOOLEANWhether intraday deltas were applied
calculation_methodVARCHAReod_only or eod_with_intraday_adjustment

Supported Chains

The function is available for all chains that have both fungible_balances_daily and fungible_credit_debit tables:
TypeChains
EVMapechain, arbitrum, avalanche, b3, base, berachain, blast, bsc, celo, core, ethereum, hyperevm, ink, linea, megaeth, monad, optimism, plasma, polygon, scroll, soneium, sonic, stable, tempo, unichain, vana, worldchain
Movesui, aptos
For EVM chains, input addresses are automatically lowercased. For non-EVM chains (SUI, Aptos), addresses are used as-is.

Granular Balances

  • In fungible_balances/balances, balances model, each entry corresponds to a specific event/transaction that causes a balance change in a particular asset at the block level.
  • This means a new 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
Use Cases:
  • Track granular, block-level changes of address and token address pairs whenever there are changes in the balance of assets