Fungible Balances

The fungible balances table contains historical native token (e.g. ETH, MATIC, AVAX) and ERC20 tokens the balance of all addresses, at block height that has a balance change for the particularly address.

Sample Query

Query wallet Balance of a wallet by token address.

select * from optimism.assets_fungible_balances 
where address = '0xd97d0911007bef00748579c5b8879a135ca31950'
and token_address = '0x0000000000000000000000000000000000000000' -- ETH

Table Columns

Column NameTypeDescriptionExample

address

varchar

Address of the account.

0xd97d0911007bef00748579c5b8879a135ca31950

token_address

varchar

Token address. Native ETH is represented as 0x0000000000000000000000000000000000000000

0x0000000000000000000000000000000000000000

raw_balance

numeric(512)

Unormalized token balance. For ETH, balance of eth in wei.

5800000000000000

block_timestamp

timestamp

The timestamp of the block that that resulted in the balance.

2023-12-11T07:50:31

block_number

bigint

The number of the block that resulted in the balance.

113341127

block_hash

varchar

The hash of the block that resulted in the balance.

0x85f382f4213d2795f63952465d94563cb1bc353c405ce7a14bd4d613ae6c1c81

Last updated