Query editor
with base as (selectdate_trunc('week', block_date) as "Week",sum(case when blockchain = 'polygon' then amount_usd else null end) as "Polygon",sum(case when blockchain = 'arbitrum' then amount_usd else null end) as "Arbitrum",sum(case when blockchain = 'ethereum' then amount_usd else null end) as "Ethereum",sum(case when blockchain = 'optimism' then amount_usd else null end) as "Optimism",count(distinct case when blockchain = 'polygon' then tx_hash else null end) as "Polygon txs",count(distinct case when blockchain = 'arbitrum' then tx_hash else null end) as "Arbitrum txs",count(distinct case when blockchain = 'ethereum' then tx_hash else null end) as "Ethereum txs",count(distinct case when blockchain = 'optimism' then tx_hash else null end) as "Optimism txs"--"Polygon" / "Polygon txs" as "Average Tx Size"from uniswap.tradeswhere block_time >= date_add('day', -365, current_date)group by 1)select*,"Polygon" / "Polygon txs" as "Avg Polygon Tx Size","Arbitrum" / "Arbitrum txs" as "Avg Arbitrum Tx Size","Ethereum" / "Ethereum txs" as "Avg Ethereum Tx Size","Optimism" / "Optimism txs" as "Avg Optimism Tx Size"from base--select * from uniswap.trades limit 100