Query editor
with blob_start as (selectblob_submitter as address,lower(coalesce(blob_submitter_label, 'Others')) as blob_submitter,min(beacon_slot_time) as start_blobingfrom ethereum.blobswhere is_blobscription = falsegroup by 1,2),price as (select date_trunc('hour',minute) as hour, avg(price) as pricefrom prices.usdwhere contract_address is nulland blockchain is nulland symbol = 'ETH'and date(minute)>=date(date('2024-03-13') - interval '30' day)group by 1),fee as (select date_trunc('hour', block_time) as hour,blockchain,approx_percentile(coalesce(l1_fee,0)/1e18+gas_price*gas_used/1e18, 0.5) as median_gas_pre,null as median_gas_postfrom evms.transactions ainner join blob_start bon lower(blockchain) = lower(blob_submitter)where block_time < start_blobingand block_time>=date(date('2024-03-13') - interval '30' day)and (casewhen '{{Transaction_Type}}' = 'All Transactions' then 1=1when '{{Transaction_Type}}' = 'NFT Trades' then hash in (select distinct tx_hash from nft.trades where block_time>=date(date('2024-03-13') - interval '30' day))when '{{Transaction_Type}}' = 'DEX Trades' then hash in (select distinct tx_hash from dex.trades where block_time>=date(date('2024-03-13') - interval '30' day))when '{{Transaction_Type}}' = 'ETH Transfers' then hash in (select distinct tx_hash from evms.traces where block_time>=date(date('2024-03-13') - interval '30' day)and value>0 and to not in (select distinct address from evms.contracts))when '{{Transaction_Type}}' = 'ERC20 Transfers' then hash in (select distinct evt_tx_hash from evms.erc20_transfers where evt_block_time>=date(date('2024-03-13') - interval '30' day))end)group by 1,2union allselect date_trunc('hour', block_time) as hour,blockchain,null as median_gas_pre,approx_percentile(coalesce(l1_fee,0)/1e18+gas_price*gas_used/1e18, 0.5) as median_gas_postfrom evms.transactions ainner join blob_start bon lower(blockchain) = lower(blob_submitter)where block_time >= start_blobingand block_time>=date(date(now() - interval '24' hour))and (casewhen '{{Transaction_Type}}' = 'All Transactions' then 1=1when '{{Transaction_Type}}' = 'NFT Trades' then hash in (select distinct tx_hash from nft.trades where block_time>=date(date('2024-03-13')))when '{{Transaction_Type}}' = 'DEX Trades' then hash in (select distinct tx_hash from dex.trades where block_time>=date(date('2024-03-13')))when '{{Transaction_Type}}' = 'ETH Transfers' then hash in (select distinct tx_hash from evms.traces where block_time>=date(date('2024-03-13'))and value>0 and to not in (select distinct address from evms.contracts))when '{{Transaction_Type}}' = 'ERC20 Transfers' then hash in (select distinct evt_tx_hash from evms.erc20_transfers where evt_block_time>=date(date('2024-03-13')))end)group by 1,2),