carlesmontalaopenbook 4
    Updated 2023-02-05
    with DefiTable as (
    select address,label
    from solana.core.dim_labels
    where label_type in ('defi','dex')
    union all
    select 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX' as address, 'OpenBook' as label)
    select block_timestamp::Date as date,
    case when date >= '2022-11-08' then 'After FTX Collapse'
    else 'Before FTX Collapse' end as period,
    initcap(label) as Project_Name,
    count (distinct tx_id) as TX_Count,
    count (distinct instruction:accounts[1]) as Users_Count
    from solana.core.fact_events t1 join DefiTable t2 on t1.program_id = t2.address
    where block_timestamp >= '2022-11-01'
    group by 1,2,3
    order by 1
    Run a query to Download Data