Query editor
WITH first_tx AS (SELECT"from" AS wallet,MIN(block_time) AS first_interactionFROM bnb.transactionsGROUP BY "from"),user_activity AS (SELECTt."from" AS wallet,DATE_TRUNC('month', t.block_time) AS active_month,f.first_interaction,CASEWHEN DATE_TRUNC('month', t.block_time) = DATE_TRUNC('month', f.first_interaction)THEN 'New User'ELSE 'Returning User'END AS user_typeFROM bnb.transactions tJOIN first_tx f ON t."from" = f.wallet)SELECTactive_month,user_type,COUNT(DISTINCT wallet) AS user_countFROM user_activityGROUP BY active_month, user_typeORDER BY active_month DESC;