Query editor
-- 4.1 Daily wNXM/ETH Uniswap V3 swap volume, count, and average size-- Pool: wNXM/ETH 0.3% fee tier | Ethereum mainnet-- Verified Pool Address: 0xC02D0fA00C0bEC48186026c71da2E54Ebf680139WITH daily_swaps AS (SELECTDATE_TRUNC('day', block_time) AS day,COUNT(*) AS swap_count,-- WETH contract address (lowercase) is the ETH side of every swap-- token_bought / token_sold are the correct dex.trades column names in Dune v2-- ELSE 0 in SUM: non-WETH rows contribute nothing to total volumeSUM(CASEWHEN token_bought_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 THEN ABS(token_bought_amount)WHEN token_sold_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 THEN ABS(token_sold_amount)ELSE 0END) AS total_eth_volume,-- ELSE NULL in AVG: excludes non-WETH rows so they don't skew the average downAVG(CASEWHEN token_bought_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 THEN ABS(token_bought_amount)WHEN token_sold_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 THEN ABS(token_sold_amount)ELSE NULLEND) AS avg_swap_size_ethFROM dex.tradesWHEREproject = 'uniswap'AND version = '3'AND blockchain = 'ethereum'AND project_contract_address = 0xc02d0fa00c0bec48186026c71da2e54ebf680139AND block_time >= NOW() - INTERVAL '90' DAYGROUP BY 1)SELECTday,swap_count,ROUND(total_eth_volume, 4) AS total_eth_volume,ROUND(avg_swap_size_eth, 4) AS avg_swap_size_ethFROM daily_swapsORDER BY day DESC