khanhDaily Defi transactions before&after Ftx Collapse
    Updated 2022-11-22
    select
    a.block_timestamp::date "Date",
    iff(program_id = 'srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX', 'openbook', label) "Program",
    case when "Date" >= '2022-11-08' then 'After FTX Collapse' else 'Before FTX Collapse' end "TimeSpan",
    count(distinct a.tx_id) "TX Number",
    count(distinct tx_from) "Users"
    from solana.core.fact_events a
    join solana.core.fact_transfers b
    on a.tx_id = b.tx_id
    left join solana.core.dim_labels on program_id = address and label_type in ('dex', 'defi')
    where "Date" >= '2022-11-01' and label is not null
    group by 1, 2, 3
    order by 1 asc, 4 desc
    Run a query to Download Data