We only use CEX USD prices to estimate the usd_amount. This has the benefit of excluding scam tokens, but some defi tokens might not be covered.

The ERC20 credit debit table allows you to easily track the inflows and outflows of every ERC20 token belonging to all addresses.

Sample Query

Getting the ERC20 Credit Debit of USDC tokens of an address.

This will provide an overview of all the in and outflows of an ERC20 token of interest to a wallet.

select * from ethereum.assets.erc20_credit_debit

where address = '0xd387a6e4e84a6c86bd90c158c6028a58cc8ac459' -- Pranksy

and token_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' -- USDC 

order by block_number desc  

Table Columns

Column NameDescriptionExampleColumn Name
addressAddress of the account that was credited or debited value amount of ERC20 token0xd387a6e4e84a6c86bd90c158c6028a58cc8ac459
counterparty_addressThe address of counter party of this credit or debit transfer.0x55fe002aeff02f77364de339a1292923a15844b8
token_addressToken address of the ERC20 token.0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
token_nameName of the ERC20 token.USD Coin
token_symbolToken symbol of this token.USDC
raw_amountAmount of tokens moved (unnormalized).49995000000
raw_amount_strAmount of tokens moved (unnormalized) in string.49995000000
amountAmount of tokens moved, normalized by the decimal points defined in the ERC20 token contract. For example, USDC has 6 decimals, so this value is the raw_value divided by 10^6.49995
amount_strAmount of tokens moved, normalized in string.49995
usd_valueThe amount of tokens moved, in USD.</td><td><code>49980.0015</code></td><td></td></tr><tr><td>usdexchangerate</td><td>Thisisthepriceofasingletoken,inUSD.</td><td><code>49980.0015</code></td><td></td></tr><tr><td>usd_exchange_rate</td><td>This is the price of a single token, in USD.

Refer to Hourly Token Prices for more information.
0.9997
transaction_hashTransaction hash that this transfer belongs to.0xcb1368a1121566799c15a1c80b0a80f2b5022b961399cc1bb7fb24321cfc1b25
log_indexThe log index that corresponds to this transfer.89
block_timestampThe timestamp of the block that the corresponding transaction of this transfer belongs to. This is also the timestamp when this transfer occurred.2022-01-28T15:17:56
block_numberThe block number that the corresponding transaction of this transfer belongs to.14094940
block_hashThe block hash that the corresponding transaction of this transfer belongs to.0x3aabbdb1d24d525053ecd3bc4a68828ab2e601cf803bef2fef824576f488e802
unique_idUnique id generated to each transfer. Includes transaction hash, log index and credit and debit transaction type. 0xcb1368a1121566799c15a1c80b0a80f2b5022b961399cc1bb7fb24321cfc1b25_log_index-89_credit