adriaparcerisasopenbook statistics
    Updated 2022-11-27
    with
    t1 as (
    select instruction:accounts[1] as user,
    min (block_timestamp) as debut
    from solana.core.fact_events
    where program_id = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX'
    and succeeded = 'TRUE'
    group by 1
    ),
    t2 as (
    select debut::date as dates,
    count (distinct user) as new_users
    from t1
    group by 1
    )
    select
    trunc(block_timestamp,'day') as date,
    --case when block_timestamp < '2022-11-08' then 'Previous to FTX/Alameda news' else 'After the FTX/Alameda news' end as period,
    count (distinct tx_id) as transactions,
    sum(transactions) over (order by date) as cum_transactions,
    new_users,
    sum(new_users) over (order by date) as cum_new_users,
    count (distinct instruction:accounts[1]) as active_users,
    sum(active_users) over (order by date) as cum_active_users
    from solana.core.fact_events t1
    join t2 on t1.block_timestamp::Date = t2.dates
    where program_id = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX'
    and succeeded = 'TRUE'
    group by 1,4
    order by 1 asc
    Run a query to Download Data