Query editor
WITH daily_dex_volume AS (SELECTdate_trunc('day', block_time) AS day,project AS dex_name,SUM(amount_usd) AS total_volume_usd,COUNT(tx_hash) AS number_of_trades,APPROX_PERCENTILE(amount_usd, 0.5) AS median_trade_size_usdFROM dex.tradesWHERE(token_bought_symbol = 'wstETH' OR token_sold_symbol = 'wstETH')AND block_time >= current_date - interval '7' dayAND blockchain = 'ethereum'GROUP BY 1, 2)SELECTday,dex_name,total_volume_usd,number_of_trades,median_trade_size_usdFROM daily_dex_volumeORDER BY day DESC, total_volume_usd DESC