Query editor
withall_trades as (selectdate_trunc('day', block_time) as block_date,*fromdune.particle_network.result_ua_trades),new_users as (selectua_address as user_address,min(block_date) as first_trade_datefromall_tradesgroup byua_address),trades_agg as (selectblock_date,sum(amount_usd) total_volume_usd,count(distinct ua_address) total_users,count(distinct tx_hash) total_trades,sum(amount_usd) * 0.01 total_fee_usd,sum(casewhen block_date >= now() - interval '7' day then amount_usdend) as seven_day_volume_usd,count(distinct casewhen block_date >= now() - interval '7' day then ua_addressend) as seven_day_users,count(distinct casewhen block_date >= now() - interval '7' day then tx_hashend) as seven_day_trades,-- volumesum(casewhen blockchain = 'solana' then amount_usdend) solana_volume_usd,sum(casewhen blockchain = 'base' then amount_usdend) base_volume_usd,sum(casewhen blockchain = 'bnb' then amount_usdend) bnb_volume_usd,sum(casewhen blockchain = 'arbitrum' then amount_usdend) arbitrum_volume_usd,