yasmin-n-d-r-hluna2 new user
    Updated 2023-01-07
    with new_wallets as (
    select
    tx_sender,
    min(block_timestamp) as new_date
    from
    terra.core.fact_transactions
    group by
    1
    ),
    info as (
    select
    date_trunc('day', new_date) as daily,
    count(distinct tx_sender) as new_count,
    avg(new_count) over (
    order by
    daily,
    daily rows between 6 preceding
    and current row
    ) as ma7_new_count,
    sum(new_count) over (
    order by
    daily
    ) as cum_new_count
    from
    new_wallets
    group by
    1
    )
    select
    *
    from
    info
    where
    daily > current_date - 30

    Run a query to Download Data