Mrftinear report - new users copy
    Updated 2025-02-05
    -- forked from MoDeFi / near report - new users @ https://flipsidecrypto.xyz/MoDeFi/q/wtCTzjMss7by/near-report---new-users

    select date_trunc({{period_type}}, BLOCK_TIMESTAMP) as "Date",
    count(distinct from_address) as "New Users",
    lag("New Users") over (order by "Date") as lag_AUs,
    round(100*("New Users"-lag_AUs)/lag_AUs,2) as "New Users Change %"
    from
    (select
    from_address,
    min(BLOCK_TIMESTAMP) as BLOCK_TIMESTAMP
    from berachain.testnet.fact_transactions where TX_SUCCEEDED=true group by 1)
    where BLOCK_TIMESTAMP::date>='{{start_day}}'
    and date_trunc({{period_type}}, BLOCK_TIMESTAMP)<=date_trunc({{period_type}}, '{{target_day}}'::date)
    group by 1
    order by 1 desc
    QueryRunArchived: QueryRun has been archived