Query editor
-- Consecutive month-over-month lifecycle transitions for the flow river (UI-only rebuilt table). Window: Jun-Sep 2026.with staged as (select period_start, wallet_address,case lifecycle_stage when 'EarlyRetained' then 'Early Retained' when 'AtRisk' then 'At Risk' else lifecycle_stage end as stagefrom dune.cowprotocol.fct_wallet_lifecyclewhere period_granularity = 'month'and period_start between date '2026-06-01' and date '2026-09-01'),pairs as (select b.period_start as from_month, b.stage as from_stage,coalesce(n.stage, 'Gone') as to_stage_rawfrom staged bleft join staged non n.wallet_address = b.wallet_addressand n.period_start = date_add('month', 1, b.period_start)where b.period_start in (date '2026-06-01', date '2026-07-01', date '2026-08-01')and b.stage in ('Activated','Early Retained','Returning','Reactivated','At Risk'))selectfrom_month,from_stage,case when to_stage_raw in ('Gone','Churned') then 'Churned/Gone' else to_stage_raw end as to_stage,count(*) as walletsfrom pairsgroup by 1, 2, 3order by 1, 2, 3