Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/WITH gas_fee AS (WITH gas_fees_per_day as (selectdate_trunc('day', block_time) as blockTimestamp,count(*) as transactionCount,avg(gas_used) as gasAvg,sum(gas_used) as gasSum,avg(gas_price_gwei) as gasPriceAvg,avg(gas_price_usd) as gasPriceAvgUsd,sum(tx_fee_native) as transactionFeeSum,sum(tx_fee_usd) as transactionFeeSumUsd,avg(tx_fee_native) as transactionFeeAvg,avg(tx_fee_usd) as transactionFeeAvgUsdFROM gas.feesWHERE (tx_receiver = 0x06450dee7fd2fb8e39061434babcfc05599a6fb8 or tx_receiver = 0x06450dee7fd2fb8e39061434babcfc05599a6fb8)GROUP BY date_trunc('day', block_time))-- Add cumulative transaction feesselect*,sum(transactionFeeSum) over (order by blockTimestamp rows unbounded preceding) as transactionFeeSumCumulative,sum(transactionFeeSumUsd) over (order by blockTimestamp rows unbounded preceding) as transactionFeeSumUsdCumulativeFROM gas_fees_per_dayWHERE blockTimestamp >= from_iso8601_timestamp('2022-10-06')ORDER BY blockTimestamp DESC)SELECT *,(select 'eth') as currency,(select 'mainnet') as network,(select 'xen') as contractFROM gas_feeWHERE blockTimestamp >= date_trunc('day', now() - interval '7' day)