Average Tip in terms of avg gas Fee
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(network: eth, dataset: combined) archive full history combined archive + realtime in one result Ar
What it returns
- block number
- balance change reason code
- currency name
- currency symbol
- smart contract
- average of fee sender fee
- sum of token balance post balance
- sum of token balance post balance in USD
- sum of token balance pre balance
- sum of token balance pre balance in USD
- calculate
- count
Filters
- token balance balance change reason code is 5
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(network: eth, 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(network: eth, dataset: realtime) {
TransactionBalances(
limit: {count: 10}
orderBy: {descending: Block_Number}
where: {TokenBalance: {BalanceChangeReasonCode: {eq: 5}}, Block: {Time: {since_relative: {hours_ago:24}}}}
) {
Block {
Number
}
TokenBalance {
BalanceChangeReasonCode
Currency {
Name
Symbol
SmartContract
}
}
avg_gasfees_in_this_block: average(of: Fee_SenderFee)
Post: sum(of: TokenBalance_PostBalance)
Post_USD: sum(of: TokenBalance_PostBalanceInUSD)
Pre: sum(of: TokenBalance_PreBalance)
Pre_USD: sum(of: TokenBalance_PreBalanceInUSD)
Total_tip_native: calculate(expression: "$Post - $Pre")
Total_tip_usd: calculate(expression: "$Post_USD - $Pre_USD")
number_of_tips: count
avg_tip_in_this_block: calculate(
expression: "$Total_tip_native / $number_of_tips"
)
avg_tip_usd_in_this_block: calculate(
expression: "$Total_tip_usd / $number_of_tips"
)
tip_in_terms_of_gasfees: calculate(
expression: "( $avg_gasfees_in_this_block - $avg_tip_in_this_block ) / $avg_gasfees_in_this_block"
)
}
}
}
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