Query editor
with date_filter as (select (casewhen '{{date_period}}' = '30 Days' then now() - interval '30' daywhen '{{date_period}}' = '3 Months' then now() - interval '3' monthwhen '{{date_period}}' = '6 Months' then now() - interval '6' monthwhen '{{date_period}}' = '1 Year' then now() - interval '1' yearelse date('2021-01-01')end) as start_date),daily_transaction as (select date_trunc('day', block_time) as block_date,count(*) as transaction_count,sum(cast(effective_gas_price as double) * gas_used) / 1e18 as gas_feefrom arbitrum.transactionsinner join date_filter on truewhere success = trueand block_time >= date_filter.start_dategroup by 1)select block_date,transaction_count,gas_fee,sum(transaction_count) over (order by block_date) / 1e6 as accumulate_transaction_count,sum(gas_fee) over (order by block_date) as accumulate_gas_feefrom daily_transactionorder by block_date