PolygonBalance Changes
Column Descriptions
for polygon.balance_changes
13 rows
Name | Type | Description |
---|---|---|
new_balance_hex | TEXT | New balance of the address after the change (in hexadecimal) |
old_balance_hex | TEXT | Old balance of the address before the change (in hexadecimal) |
new_balance | NUMBER | New balance of the address after the change (in Wei) |
block_number | NUMBER | Block number in which the balance change occurred |
old_balance | NUMBER | Old balance of the address before the change (in Wei) |
reason_code | NUMBER | Numeric code representing the reason for the balance change |
ordinal | NUMBER | Ordinal of the balance change within the block |
block_date | DATE | Date of the block in which the balance change occurred |
tx_hash | TEXT | Hash of the transaction that caused the balance change |
reason | TEXT | Reason for the balance change (e.g., 'Call', 'Create', 'Fee', etc.) |
address | TEXT | Address whose balance changed |
block_hash | TEXT | Hash of the block in which the balance change occurred |
block_time | TIMESTAMP_NTZ | Timestamp of the block in which the balance change occurred |
Sample Queries
Calculate Daily ETH Balance Change for an Address
Calculates the net change in ETH balance for a specific address per day. The result is returned in Ether instead of Wei.
SELECT
block_date,
SUM(new_balance - old_balance) / 1e18 AS daily_balance_change_ether
FROM
polygon.balance_changes
WHERE
address = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
GROUP BY
block_date
ORDER BY
block_date;
Find Largest Balance Increases
Identifies the top 10 largest balance increases for any address, showing the old and new balances, and the reason. The result is returned in Ether instead of Wei.
SELECT
address,
(old_balance / 1e18) as old_balance_ether,
(new_balance / 1e18) as new_balance_ether,
reason
FROM
polygon.balance_changes
ORDER BY
(new_balance - old_balance) DESC
LIMIT
10;
Transaction Hashes with Fee Balance Changes
Retrieves the transaction hashes associated with balance changes where the reason is 'Fee'.
SELECT DISTINCT
tx_hash
FROM
polygon.balance_changes
WHERE
reason = 'Fee';