Query editor
--The goal for this query is to compare dex performances in ethereum over the last one year--WITH dex_metrics AS (SELECTproject,COUNT(*) num_trades,SUM(amount_usd) AS total_volume_usd,AVG(amount_usd) AS avg_trade_volume_usd,COUNT(DISTINCT token_pair) AS num_token_pairsFROM dex.tradesWHERE block_time >= CURRENT_DATE - INTERVAL '365' DAYAND blockchain = 'ethereum'GROUP BY project)SELECT --FINAL SELECT--project,num_trades,total_volume_usd,avg_trade_volume_usd,num_token_pairsFROM dex_metricsORDER BY total_volume_usd DESCLIMIT 10