Query editor
with transaction_gas_used_cum as (with transaction_gas_used as (select date_trunc('day', block_time) as blockTimestamp,count(*) as transactionCount,avg(gas_used) as gasAvg,sum(gas_used) as gasSum,avg(gas_price) / 1e9 as gasPriceAvg,avg(gas_price / 1e18 * p.price) as gasPriceAvgUsd,avg(gas_used * gas_price / 1e18) as transactionFeeAvg,avg(gas_used * gas_price / 1e18 * p.price) as transactionFeeAvgUsd,sum(gas_price * gas_used / 1e18) as transactionFeeSum,sum(gas_price * gas_used / 1e18 * p.price) AS transactionFeeSumUsdFROM ethereum.transactions tLEFT JOIN prices.usd AS pON date_trunc('minute', t.block_time) = p.minuteAND p.contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2where ("to" = 0x0a252663DBCc0b073063D6420a40319e438Cfa59 or "from" = 0x0a252663DBCc0b073063D6420a40319e438Cfa59)group by date_trunc('day', block_time))select *,sum(transactionFeeSum) over (order by blockTimestamp rows unbounded preceding) as transactionFeeSumCumulative,sum(transactionFeeSumUsd) over (order by blockTimestamp rows unbounded preceding) as transactionFeeSumUsdCumulative,(select 'eth') as currency,(select 'mainnet') as network,(select 'xenft') as contractfrom transaction_gas_usedwhere blockTimestamp >= from_iso8601_timestamp('2022-10-06')order by blockTimestamp desc)select * from transaction_gas_used_cum where blockTimestamp >= date_trunc('day', now() - interval '7' day)