SniperMonthly New Users
    Updated 2023-09-04
    with tb1 as (
    select
    min(a.block_timestamp) as min_date,
    b.PUBKEY_SCRIPT_ADDRESS as user
    from
    bitcoin.core.fact_outputs a
    left outer join bitcoin.core.fact_inputs b on a.tx_id = b.tx_id
    where
    a.PUBKEY_SCRIPT_ADDRESS = 'bc1qw8wrek2m7nlqldll66ajnwr9mh64syvkt67zlu'
    group by
    2
    ),
    tb2 as (
    select
    trunc(min_date, 'month') as monthly,
    count(DISTINCT user) as new_users,
    sum(new_users) over (
    order by
    monthly asc
    ) as cumulative_nwe
    from
    tb1
    group by
    1
    ),
    tb3 as (
    select
    trunc(b.block_timestamp, 'month') as monthly,
    count(DISTINCT b.PUBKEY_SCRIPT_ADDRESS) as uniqe_users
    from
    bitcoin.core.fact_outputs a
    left outer join bitcoin.core.fact_inputs b on a.tx_id = b.tx_id
    where
    a.PUBKEY_SCRIPT_ADDRESS = 'bc1qw8wrek2m7nlqldll66ajnwr9mh64syvkt67zlu'
    group by
    1
    Run a query to Download Data