Sniper2023-06-28 02:57 AM
    Updated 2023-06-27
    with
    news as (
    SELECT
    distinct signer_id,
    min(trunc(block_timestamp,'week')) as debut
    from near.social.fact_addkey_events
    group by 1
    )
    ,
    final as(
    select
    trunc(block_timestamp,'week') as week,
    count(distinct tx_hash) as events,
    sum(events) over (order by week) as total_events,
    count(distinct x.signer_id) as users,
    count(distinct y.signer_id) as new_users,
    sum(new_users) over (order by week) as total_unique_users
    from near.social.fact_addkey_events x
    join news y on trunc(x.block_timestamp,'week')=y.debut
    group by 1 order by 1 asc )
    select sum (users) from final

    Run a query to Download Data