crosschain.balances Table: ez_optimism_balances_erc20_daily Type: View
What
This convenience table provides a comprehensive view of daily ERC20 token balance snapshots with enriched metadata including decimal adjustments, USD values, and token information, specifically covering verified tokens only. It simplifies balance analysis by capturing end-of-day token holdings for each address-token pair through directbalanceOf contract calls across all supported EVM blockchains. It contains a column for the blockchain the balance snapshot occurred on, which is an important filter and join key. See evm.dim_chains for a list of all supported EVM chains.
Note: This is a unified view that combines ERC20 token balance data from multiple EVM blockchains. Each row includes a blockchain identifier to distinguish between different networks.
Key Use Cases
- Daily portfolio tracking and balance monitoring for ERC20 tokens
- Historical balance analysis and trend identification
- Token holder distribution analysis at daily granularity
- Wallet balance snapshots for reporting and analytics
- Cross-token balance comparisons and concentration analysis
- Token supply distribution monitoring over time
- Daily balance-based yield and return calculations
Important Relationships
- Join with evm__fact_blocks: Use
block_numberandblockchainfor block metadata and timestamps - Join with core__dim_labels: Use
addressandblockchainfor entity identification and categorization - Join with evm__dim_contracts: Use
contract_addressandblockchainfor token contract details - Complement to balances__ez_balances_native_daily: Complete picture of token holdings
- Join with evm__ez_token_transfers: Compare daily balances with transfer activity
Commonly-used Fields
address: The account address holding the token balancecontract_address: The ERC20 token contract addresssymbol: Token symbol (USDC, WETH, etc.)balance: Token balance at end of day, decimal adjusted to standard unitsbalance_usd: USD value of the token balance at end of daybalance_raw: Raw balance in smallest token unit (wei equivalent)balance_precise: Precise decimal-adjusted balance as stringdecimals: Number of decimal places for the tokenblock_date: The date for which this balance snapshot was takenblockchain: The blockchain the balance snapshot occurred on
Sample queries
Daily Token Holdings by AddressColumns
| Column Name | Data Type | Description |
|---|---|---|
| BLOCKCHAIN | TEXT | The blockchain the record occurred on. See evm.dim_chains for a list of all EVM chains. Format: VARCHAR Example: ‘ethereum’ Usage: Filtering by blockchain Joining across tables Analyzing chain-specific patterns |
| BLOCK_NUMBER | NUMBER | Sequential counter representing the position of a block in the blockchain since genesis (block 0). Key Facts: Immutable once finalized Primary ordering mechanism for blockchain data Increments by 1 for each new block Used as a proxy for time in many analyses Usage in Queries: Important: Block numbers are chain-specific. Block 15000000 on Ethereum ≠ block 15000000 on Polygon. |
| BLOCK_DATE | DATE | The date for which this balance snapshot represents the end-of-day token balance. Example: ‘2025-07-04’ |
| ADDRESS | TEXT | The account address whose token balance is recorded in this daily snapshot. Example: ‘0x1234567890123456789012345678901234567890’ |
| CONTRACT_ADDRESS | TEXT | The verified ERC20 token contract address for which the balance is recorded. Example: ‘0xa0b86a33e6eb88b4d81b15e4e60c8a5b776e3b7a’ |
| DECIMALS | NUMBER | Number of decimal places for the token, used for proper decimal adjustment in balance calculations. Example: 6 |
| SYMBOL | TEXT | The token symbol for the ERC20 token. Example: ‘USDC’ |
| BALANCE_HEX | TEXT | Hexadecimal representation of the token balance as returned by the balanceOf contract call. Example: ‘0x0000000000000000000000000000000000000000000000000000000000364d3e’ |
| BALANCE_RAW | NUMBER | Token balance in the smallest unit (wei equivalent) without decimal adjustment, as returned by the contract. Example: 1000000000 |
| BALANCE_PRECISE | TEXT | Token balance with proper decimal adjustment, returned as a string to preserve precision. Example: ‘1000.000000’ |
| BALANCE | FLOAT | Token balance with decimal adjustment converted to a float for easier mathematical operations. Example: 1000.0 |
| BALANCE_USD | FLOAT | USD value of the token balance at the end of the day, calculated using hourly price data. Example: 1000.50 |
| EZ_BALANCES_ERC20_DAILY_ID | TEXT | Primary key - unique identifier for each row ensuring data integrity. Format: Usually VARCHAR containing composite key generated using MD5 hash of the relevant columns. Example: MD5(blocknumber, txhash, trace_index) Usage: Deduplication in incremental loads Join operations for data quality checks Troubleshooting specific records Important: Implementation varies by table - check table-specific documentation. |
| INSERTED_TIMESTAMP | TIMESTAMP_NTZ | UTC timestamp when the record was first added to the Flipside database. Format: TIMESTAMP_NTZ Use Cases: Data freshness monitoring Incremental processing markers Debugging data pipeline issues SLA tracking Query Example: |
| MODIFIED_TIMESTAMP | TIMESTAMP_NTZ | UTC timestamp of the most recent update to this record. Format: TIMESTAMP_NTZ Triggers for Updates: Data corrections Enrichment additions Reprocessing for accuracy Schema migrations Monitoring Usage: |