Balances & Holders Cubes
Balances and Holders are derived views that answer "what is true now", so there is no
underlying event to push. A subscription against either is a valid document and the socket
stays open, but no message is ever delivered — on EVM or Tron.
For live balances, read the balance once and then keep it current from a stream that does
fire: EVM.TransactionBalances or EVM.Transfers (and Tron.Transfers on Tron). See
which cubes support subscriptions.
Two cubes answer balance questions, and picking the right one matters more than the fields you select:
| Cube | Question it answers | Shape |
|---|---|---|
Balances | What does this address hold? | Current balance per address, live — no snapshot date |
Holders | Who holds this token? | A token's holders ranked by balance, as a dated snapshot |
Both read from aggregate-state tables (balances_by_address / balances_by_currency), so they return the current state directly instead of replaying every change.
Balances and Holders exist on EVM networks (EVM(network: …)) and Tron (Tron).
They do not exist on Solana. Solana balance changes are queried with Solana.BalanceUpdates and Solana.InstructionBalanceUpdates.
Balances — what an address holds
Balances returns one row per address/currency pair with the current amount.
Balance fields: Address, Amount, AmountInUSD, UpdateCount, FirstChangeTime, LastChangeTime.
Its where filter accepts Balance.Address plus Currency and Block. Note there is no amount filter on Balances — see Holders if you need to filter or rank by balance size.
Token balance for one or more addresses
query TokenBalances($addresses: [String!], $token: String!) {
EVM(network: eth, dataset: combined) {
Balances(
where: {
Balance: { Address: { in: $addresses } }
Currency: { SmartContract: { is: $token } }
}
orderBy: { descending: Balance_Amount }
) {
Balance {
Address
Amount
AmountInUSD
UpdateCount
LastChangeTime
}
Currency {
Symbol
Name
SmartContract
}
}
}
}
{
"addresses": [
"0x28C6c06298d514Db089934071355E5743bf21d60",
"0x21a31Ee1afC51d94C2eFcCAa2092aD1028285549"
],
"token": "0xdac17f958d2ee523a2206206994597c13d831ec7"
}
To exclude zero balances, apply the filter on the field rather than in where:
Amount(selectWhere: { gt: "0" }).
Native balance
Filter on Currency: { Native: true } to get the chain's native asset instead of a token:
{
EVM(network: eth, dataset: combined) {
Balances(
where: {
Balance: { Address: { is: "0x28C6c06298d514Db089934071355E5743bf21d60" } }
Currency: { Native: true }
}
) {
Balance {
Address
Amount
AmountInUSD
}
Currency {
Symbol
Native
}
}
}
}
The same query works on Tron by swapping the selector for Tron and using a Tron address.