EVM Balance API
Query-only
A subscription on Balances is accepted but never pushes a message. Poll it, or stream
TransactionBalances / Transfers and apply deltas. See
which cubes support subscriptions.
The Balances API returns current and historical token balances for addresses on EVM chains. To return only non-zero balances, add Amount(selectWhere: { gt: "0" }) on the Balance field (not in where). Use dataset: combined or dataset: archive as follows:
| Dataset | When to use |
|---|---|
combined | Latest balances. Queries realtime and archive databases and merges results. |
archive | Historical snapshots with Block.Date, and balances for addresses not recently active. |
Full Ethereum examples: Address Balance API.
Balance of an address
query {
EVM(network: eth, dataset: combined) {
Balances(
where: {
Balance: {
Address: {
is: "0x76147fd7891731e01f35cc18f87ae8e95bf06869"
}
}
}
) {
Currency {
Symbol
SmartContract
}
Balance {
Amount(selectWhere: { gt: "0" })
AmountInUSD
Address
}
}
}
}