Query editor
-- Analysis of WETH (Wrapped Ethereum) buyers and sellers on Ethereum-- Token: WETH (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)-- Timeframe: Last 30 daysWITH weth_trades AS (SELECTtaker,maker,token_bought_address,token_sold_address,token_bought_symbol,token_sold_symbol,amount_usd,tx_hash,block_timeFROM dex.tradesWHERE blockchain = 'ethereum'AND block_time >= CURRENT_DATE - INTERVAL '30' DAYAND (token_bought_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- WETH boughtOR token_sold_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- WETH sold)),buyers AS (-- Users who bought WETHSELECTtaker AS buyer_address,COUNT(*) AS buy_count,SUM(amount_usd) AS total_buy_volume_usdFROM weth_tradesWHERE token_bought_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2GROUP BY taker),sellers AS (-- Users who sold WETHSELECTtaker AS seller_address,COUNT(*) AS sell_count,SUM(amount_usd) AS total_sell_volume_usdFROM weth_tradesWHERE token_sold_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2GROUP BY taker),summary AS (SELECT(SELECT COUNT(DISTINCT buyer_address) FROM buyers) AS unique_buyers,(SELECT COUNT(DISTINCT seller_address) FROM sellers) AS unique_sellers,(SELECT SUM(buy_count) FROM buyers) AS total_buy_transactions,(SELECT SUM(sell_count) FROM sellers) AS total_sell_transactions,(SELECT SUM(total_buy_volume_usd) FROM buyers) AS total_buy_volume,(SELECT SUM(total_sell_volume_usd) FROM sellers) AS total_sell_volume)SELECTunique_buyers,unique_sellers,total_buy_transactions,