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 avalanche_c.transactions tLEFT JOIN prices.usd AS pON date_trunc('minute', t.block_time) = p.minuteAND p.contract_address = 0x1ce0c2827e2ef14d5c4f29a091d735a204794041where ("to" = 0xC0C5AA69Dbe4d6DDdfBc89c0957686ec60F24389 or "from" = 0xC0C5AA69Dbe4d6DDdfBc89c0957686ec60F24389)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 'avax') as currency,(select 'avalanche') as network,(select 'xen') 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)