messariflow stats: active users (over time) weekly copy
    Updated 2025-04-16
    -- forked from adriaparcerisas / flow stats: active users (over time) weekly @ https://flipsidecrypto.xyz/adriaparcerisas/q/WJPW_oThin6W/flow-stats-active-users-over-time-weekly


    with
    news as (
    SELECT
    distinct authorizers as users,
    min(trunc(block_timestamp,'day')) as debut
    from flow.core.fact_transactions
    group by 1
    ),
    news2 as (
    select distinct debut,
    count(distinct users) as new_users
    from news group by 1
    ),
    actives as (
    SELECT
    trunc(block_timestamp,'day') as day,
    count(distinct authorizers) as active_users
    from flow.core.fact_transactions x
    group by 1 order by 1 desc
    )
    select
    day, active_users,new_users
    from actives a join news2 n on a.day=n.debut
    --where month<trunc(current_date,'week')
    order by 1 asc





    QueryRunArchived: QueryRun has been archived