Balance update after transfer received from multiple addresses
Historical data This query uses the realtime dataset (the default), which holds only a recent window - hours to days depending on the cube. For older data add a dataset to the top-level element: EVM(dataset: combined) archive full history combined archive + realtime in one result Archive and comb
What it returns
- block time
- pre balance
- post balance
- pre balance in USD
- post balance in USD
- from
- to
- transaction hash
- calculate
Filters
- transaction to is 0xafd8…f00e or 0x5b43…efd1
- token balance balance change reason code is 10
The query
# Historical data
# This query uses the realtime dataset (the default), which holds only a
# recent window - hours to days depending on the cube.
#
# For older data add a dataset to the top-level element:
#
# EVM(dataset: combined)
#
# archive full history
# combined archive + realtime in one result
#
# Archive and combined need the historical data add-on:
# https://bitquery.io/pricing
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
query MyQuery {
EVM {
TransactionBalances(
where: {TokenBalance: {BalanceChangeReasonCode: {eq: 10}}, Transaction: {To: {in: ["0xafd8cd311c7bf2635573ebebb97c1a3c7e90f00e", "0x5b43453fce04b92e190f391a83136bfbecedefd1"]}}}
orderBy: {descending: Block_Time}
limitBy: {by:Transaction_To count: 1}
) {
Block{
Time
}
TokenBalance {
PreBalance
PostBalance
PreBalanceInUSD
PostBalanceInUSD
}
Transaction{
From
To
Hash
}
amount:calculate(expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance")
amount_usd:calculate(expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD")
}
}
}
Similar queries
- latest token supply on USDT and USDC on ethereum chain · Ethereum · TransactionBalances
- Get Token Total Supply and Market Cap · Ethereum · TransactionBalances
- latest token supply of all active tokens on ETH chain · Ethereum · TransactionBalances
- Transaction balances · Ethereum · TransactionBalances
- All MEV Builders Tx Balance Tracker · Ethereum · TransactionBalances