Query editor
-- AX1 Wallet Wars non-token wallet deep dive.-- Base model: query_7703964.-- Parameters: days_back, chain, wallet_group, fee_rate.WITH params AS (SELECT LOWER('all') AS chain_filter),filtered AS (SELECT *FROM query_7703964CROSS JOIN params pWHERE wallet_group = 'non_token'AND day >= CURRENT_TIMESTAMP - INTERVAL '30' DAYAND (p.chain_filter = 'all' OR chain_scope = p.chain_filter)),source_rollup AS (SELECTwallet_name,source_kind,SUM(swap_volume_usd) AS swap_volume_usd,SUM(swap_txs) AS swap_txs,SUM(active_users) AS active_user_days,SUM(revenue_proxy_usd) AS revenue_proxy_usd,SUM(growth_events) AS growth_events,ARRAY_JOIN(ARRAY_AGG(DISTINCT source_name), ' | ') AS source_names,ARRAY_JOIN(ARRAY_AGG(DISTINCT notes), ' | ') AS coverage_notesFROM filteredGROUP BY 1, 2)SELECTwallet_name,source_kind,ROUND(COALESCE(swap_volume_usd, 0), 2) AS swap_volume_usd,COALESCE(swap_txs, 0) AS swap_txs,COALESCE(active_user_days, 0) AS active_user_days,ROUND(COALESCE(revenue_proxy_usd, 0), 2) AS revenue_proxy_usd,COALESCE(growth_events, 0) AS growth_events,source_names,coverage_notesFROM source_rollupORDER BY swap_volume_usd DESC, revenue_proxy_usd DESC, growth_events DESC, wallet_name;