bergCumulative Raydium Users Over last 3 months
    Updated 2023-02-17
    with
    min_date_list as (
    select swapper, min (block_timestamp) as min_date
    from solana.core.fact_swaps
    where swap_program in ('ORCA Token Swap V2', 'orca token swap')
    group by swapper
    ),
    list1 as (
    select date_trunc('day', min_date)::date as day,
    count(distinct swapper) as new_users
    from min_date_list
    group by day
    )

    select list1.day "Day",
    count(distinct swapper) "Users",
    new_users "New Users",
    sum("Users") over (order by day asc) "Comulative Users",
    sum("New Users") over (order by day asc) "Comulative New Users"
    from solana.core.fact_swaps
    join list1
    on list1.day = block_timestamp::date
    where succeeded = 1
    and list1.day >= current_date - interval '90 days'
    and swap_program in ('ORCA Token Swap V2', 'orca token swap')
    group by 1, 3
    Run a query to Download Data