Query editor
WITHall_trades AS (SELECTCASEWHEN LENGTH(t.aggregator_name) > 1 THEN LOWER(t.aggregator_name)ELSE LOWER(t.project)END AS marketplace,date_trunc('Month', t.block_time) AS month,t.amount_usd as trade_size_usd,t.amount_usd / pu.price AS trade_sizeFROMnft.trades tINNER JOIN prices.usd pu ON (t.blockchain = pu.blockchainAND CAST(pu.contract_address AS VARCHAR) = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'AND pu.minute = date_trunc('minute', t.block_time))WHEREt.blockchain = 'ethereum'AND t.block_time >= TIMESTAMP '2021-01-01'),trades as (SELECTmarketplace,month,SUM(trade_size_usd) as volume_usd,SUM(trade_size) as volumeFROMall_tradesWHEREtrade_size_usd <= 10000AND NOT CONTAINS(ARRAY['skillet','liquidifty','collectionswap','gigamart','flip','tiny astro','trove','nftinit','archipelago','okx','alpha sharks','uniswap','bitkeep','rarity garden','magic eden'],marketplace)GROUP BY1,2)SELECT*FROMtrades