Query editor
WITH eth_prices AS (SELECTDATE_TRUNC('hour', minute) AS hour,price AS price_usdFROM prices.usdWHEREsymbol = 'ETH'), trades_with_prices AS (SELECTDATE_TRUNC('day', block_time) AS block_date,CASEWHEN LOWER(aggregator_name) LIKE '%opensea%'THEN 'Opensea'WHEN LOWER(aggregator_name) LIKE '%blur%'THEN 'Blur'WHEN LOWER(aggregator_name) LIKE '%looksrare%'THEN 'LooksRare'ELSE 'Other'END AS platform,amount_original AS volume_eth,amount_original * eth_prices.price_usd AS volume_usd,tx_hashFROM nft.tradesLEFT JOIN eth_pricesON DATE_TRUNC('hour', block_time) = eth_prices.hourWHEREblock_time >= CURRENT_TIMESTAMP - INTERVAL '30' day)SELECTblock_date,platform,SUM(volume_eth) AS total_volume_eth,SUM(volume_usd) AS total_volume_usd,COUNT(DISTINCT tx_hash) AS tx_countFROM trades_with_pricesGROUP BYblock_date,platformORDER BYblock_date,platform