ArioMUX Distribution of Users by # Active Days
    Updated 2024-04-08
    with User_stats as (
    select
    distinct from_address as User_address,
    count (Distinct date_trunc(day, block_timestamp)) as "# Active Days"
    from
    avalanche.core.fact_transactions
    where
    to_address = '0x5898c3e218a8501533d771c86e2fa37743ea2add'
    and STATUS = 'SUCCESS'
    group by
    1
    )
    select
    case
    when "# Active Days" = 1 then 'A: 1 Day'
    when "# Active Days" > 1
    and "# Active Days" <= 10 then 'B: 1-10 Days'
    when "# Active Days" > 10
    and "# Active Days" <= 30 then 'C: 10-30 Days'
    when "# Active Days" > 30
    and "# Active Days" <= 60 then 'D: 30-60 Days'
    when "# Active Days" > 60
    and "# Active Days" <= 90 then 'E: 60-90 Days'
    when "# Active Days" > 90
    and "# Active Days" <= 180 then 'E: 90-180 Days'
    else 'F: > 180 Days'
    end as Status,
    count(distinct User_address) as "# Users"
    from
    User_stats
    group by
    1
    QueryRunArchived: QueryRun has been archived