Afonso_DiazDaily Defi Transactions Classifying by Platform
    Updated 2023-01-26
    select
    block_timestamp::date as day,
    label as platform,
    iff(block_timestamp >= date('2022-12-23'), 'After BONK', 'Before BONK') as timespan,
    count(distinct tx_id) as txns_count,
    count(distinct instruction:accounts[1]) as users_count,
    sum(txns_count) over (partition by label order by day) as cumulative_txns_count,
    sum(txns_count) over (partition by label order by day) as cumulative_users_count
    from solana.core.dim_labels
    join solana.core.fact_events
    on address = program_id
    where block_timestamp >= date('2022-12-01')
    and label_type in ('defi', 'dex')
    and succeeded = 1
    group by 1, 2, 3
    order by 1
    Run a query to Download Data