Query editor
-- Dune Query: new_wallets-- Schedule: Daily at 06:00 UTC-- Output: week, project, new_wallets-- Target: dune_new_wallets table in ClickHouse---- Identifies wallets whose first interaction with a project falls in the given week.-- Uses dex.trades as the interaction source.WITH first_seen AS (SELECTtaker AS wallet,project,MIN(block_date) AS first_dateFROM dex.tradesWHERE block_date >= date_add('day', -90, current_date)AND taker IS NOT NULLGROUP BY 1, 2)SELECTCAST(date_trunc('week', first_date) AS DATE) AS week,project,CAST(COUNT(DISTINCT wallet) AS INTEGER) AS new_walletsFROM first_seenWHERE first_date >= date_add('day', -14, current_date)GROUP BY 1, 2ORDER BY 1, 3 DESC