Wallet Balances
Ethereum Native Wallet Balance tables available to query via SQL
Last updated
Ethereum Native Wallet Balance tables available to query via SQL
Last updated
Native Wallet Balance specific tables
Table Name | Description |
---|---|
The columns and their schema for each table can be viewed with the describe <table> command. For example:
One of the most fundamental queries to make on any blockchain is the native currency balance of a wallet. The eth.wallet_balances
table contains a block-level view of all Ether balance changes due to gas fees, withdrawals, and committed external and internal (contract) transactions.
Getting the balance of a wallet becomes a simple act of querying the absolute balance (in gwei) at the last block that it changed:
This dataset contains the balance_gwei
(Ether balance, in gwei) at the block in question, as well as an estimated balance_usd
in USD. In cases where the gwei balance is too large to represent efficiently, the full value can be extracted programmatically from the hexadecimal string representation in the balance_hex
column.
Historical wallet balance data can also be queried:
Additionally, the most recent 30 minutes of wallet balance changes are cached in a high performance recent table eth.recent_wallet_balances
.
The above datasets combine to facilitate rich, performant, historical data access beyond the standard offerings in class. Going forward, additional SQL representations that would make other common access patterns even easier are being consider. Reach out on Discord if you have use cases not covered here.
Query performance can be significantly improved by adding WHERE
clauses to your query on specific indexed columns.
Table Name | Indexed Columns |
---|---|
A block-level view of all changes to any account's Ether balance
eth.recent_wallet_balances
Balances changed in the last 30 minutes, ~128 blocks
eth.wallet_balances
block_number
block_timestamp
address
eth.recent_wallet_balances
block_number
block_timestamp
address