Query editor
WITH cex AS (SELECT *FROM cex.addressesWHERE cex_name IN ('Binance', 'Coinbase', 'OKX', 'Bybit', 'Upbit', 'HTX', 'Kraken', 'KuCoin', 'Bitget')),tx AS (SELECT *FROM ethereum.transactionsWHERE "from" IN (SELECT address FROM cex)AND block_time >= NOW() - INTERVAL '3' monthUNION ALLSELECT *FROM ethereum.transactionsWHERE "to" IN (SELECT address FROM cex)AND block_time >= NOW() - INTERVAL '3' month),labels AS (SELECTtx.*,COALESCE(c1.cex_name, c2.cex_name, 'null') AS nameFROM txLEFT JOIN cex c1 ON c1.address = tx."from"LEFT JOIN cex c2 ON c2.address = tx."to")SELECTname,SUM(value / 1e18) AS total_volume -- Convert wei to EtherFROM labelsGROUP BY nameORDER BY total_volume DESC;