Balances
Block-level balances of assets on EVM-compatible blockchains.
Concept
Balances tell the amount of assets held by each address at a specific block height. We track balances across all major token standards:
Native tokens (e.g., ETH, MATIC)
ERC20 tokens (e.g., USDC, WETH)
ERC721 tokens (NFTs)
ERC1155 tokens (Multi-tokens)
Balance Tracking Methodology
For Fungible Tokens (Native & ERC20):
We detect balance-changing events (transfers, mints, burns)
At each relevant block height, we read the actual on-chain balance
This ensures accuracy by capturing any non-standard balance modifications
For Non-Fungible Tokens (ERC721 & ERC1155):
We track transfers through standard events:
ERC721: Transfer() events
ERC1155: TransferSingle() and TransferBatch() events
Build credit-debit tables to calculate cumulative ownership
Account for minting, burning, and transfers between addresses
Precision Handling
To maintain numerical precision, especially for tokens with large supplies or many decimal places:
Raw balances are stored as VARCHAR to preserve exact values
Normalized balances are calculated using high-precision arithmetic
Custom UDFs (User-Defined Functions) handle mathematical operations
Both raw and human-readable balances are provided
This approach ensures:
No loss of precision from floating-point arithmetic
Accurate balance tracking over time
Reliable historical data for analysis
Sample Query
How to generate daily balances from block-level balances table.
Last updated