Query editor
with txs as (selectt1.block_time,t1.blockchain,casewhen t1.blockchain='optimism' then --'Optimism'(t1.l1_fee/1e18)+ t1.gas_used*(t1.gas_price/1e18)when t1.blockchain='zksync' then --'zkSync't1.gas_used*(t1.gas_price/1e18)when t1.blockchain='base' then --'Base'(t1.l1_fee/1e18)+ t1.gas_used*(t1.gas_price/1e18)when t1.blockchain='arbitrum' then --'Arbitrum'((t1.effective_gas_price) * t1.gas_used ) / 1e18when t1.blockchain='zora' then --'Zora'(t1.l1_fee/1e18)+ t1.gas_used*(t1.gas_price/1e18)when t1.blockchain='scroll' then --'Zora'(t1.l1_fee/1e18)+ t1.gas_used*(t1.gas_price/1e18)end as total_fee,'ETH' as actual_fee_unitfromevms.transactions as t1where t1.blockchain in ('optimism', 'base', 'zora','zksync','arbitrum', 'scroll')and t1.block_time >= date_trunc('day',NOW() - interval '{{interval_days}}' day)union allselectblock_time,'linea' as blockchain,gas_used*(gas_price/1e18) as total_fee,'ETH' as actual_fee_unitfrom linea.transactionswhere block_time >= date_trunc('day',NOW() - interval '{{interval_days}}' day)union allselectblock_time,'blast' as blockchain,(l1_fee/1e18)+ gas_used*(gas_price/1e18) as total_fee,'ETH' as actual_fee_unitfrom blast.transactionswhere block_time >= date_trunc('day',NOW() - interval '{{interval_days}}' day)union allselectblock_time,'starknet' as blockchain,actual_fee_amount/1e18 as total_fee,case when actual_fee_unit='FRI' then 'STRK'when actual_fee_unit='WEI' then 'ETH' end as actual_fee_unitfrom starknet.transactionswhere block_time >= date_trunc('day',NOW() - interval '{{interval_days}}' day)),tx_prices as (selectt1.*,t2.pricefrom txs as t1left join prices.usd as t2 on date_trunc('minute', t1.block_time)=t2.minute andt2.contract_address = (case when actual_fee_unit='ETH' then 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2when actual_fee_unit='STRK' then 0xca14007eff0db1f8135f4c25b34de49ab0d42766 end))