Monitor balance and gas fee paid for an address using stream
Streams transaction balances on Ethereum as they happen, where token balance address is 0x18bb…b290 and token balance balance change reason code is 6: pre balance, pre balance in USD, post balance, post balance in USD and calculate.
What it returns
- pre balance
- pre balance in USD
- post balance
- post balance in USD
- calculate
Filters
- token balance address is 0x18bb…b290
- token balance balance change reason code is 6
The subscription
subscription {
EVM(network: eth) {
TransactionBalances(
where: {TokenBalance: {BalanceChangeReasonCode: {eq: 6}, Address: {is: "0x18bb896994283bd9c16aa2072777a97c12f1b290"}}}
) {
TokenBalance {
PreBalance
PreBalanceInUSD
PostBalance
PostBalanceInUSD
}
fee_paid: calculate(
expression: "$TokenBalance_PreBalance - $TokenBalance_PostBalance"
)
fee_paid_usd: calculate(
expression: "$TokenBalance_PreBalanceInUSD - $TokenBalance_PostBalanceInUSD"
)
}
}
}
Similar queries
- get latest balance of a pool and it's tokens · Ethereum · TransactionBalances
- balance of address stream · Ethereum · TransactionBalances
- Watch MEV Rewards to Builders · Ethereum · TransactionBalances
- All Self-Destruct Event Balances Stream · Ethereum · TransactionBalances
- token balance stream on EVM · Ethereum · TransactionBalances