Skip to main content
Holder balances are computed at query time from Transfers: every movement splits into its debit and its credit leg, and the legs add up per account. Each function takes a chain, a token address and a token standard, and reads that token’s whole movement history. There are two pairs, and which one you want depends on the token. The generic pair below works on any token on any chain the catalog conforms, from transfer records alone. The curated pair works only on the tokenized assets in the registry, and for those it is the one to use: its numbers are reconciled against the supply the mint and burn events account for, and it refuses to answer where the answer would be wrong rather than returning a figure nobody checked.

Any token

calculate_latest_token_balances and calculate_historical_eod_token_balances, documented below. Broad coverage, no per-issuer handling. On a rebasing token these drift, because a balance that grows without a transfer leaves no record to add up.

Tokenized assets

calculate_latest_asset_token_balances and calculate_historical_eod_asset_token_balances. Registry assets only, and they return a refusal rather than a number where a deployment cannot be modelled. In progress: under test, not yet served.

Functions

functions.calculate_latest_token_balances returns the current holders of one token: each account’s most recent end-of-day balance, kept where it is positive. Picking the most recent row first and applying the positive filter second is what makes the result the holder set today.
ParameterTypeDescription
p_chain_idSTRINGChain the token is deployed on, for example ethereum.
p_token_addressSTRINGContract address of the token. An erc20 address is lowercased for you, so a checksummed address copied from an explorer resolves; every other standard is matched as the chain writes it, spl and trc20 being base58.
p_token_typeSTRINGToken standard: erc20, spl or trc20.
Return columnTypeDescription
account_addressSTRINGAccount holding a positive balance: a wallet on the log-shaped chains, an SPL token account on Solana.
balanceBIGNUMERICLatest end-of-day balance in token units. Added up in exact whole-number arithmetic and scaled by the token’s decimals, so a drained account reads exactly zero and leaves the holder set.

Sample queries

Each call adds up the token’s whole movement history, so a one-off holder set costs a full scan. Assets ▸ Metrics holds a daily supply and holder-count series for curated assets.