Afonso_DiazDaily Optimism Defi Transactions
    Updated 2023-01-26
    select
    block_timestamp::date as day,
    iff(block_timestamp >= date('2022-12-23'), 'After BONK', 'Before BONK') as timespan,
    count(distinct tx_hash) as txns_count,
    count(distinct origin_from_address) as users_count,
    sum(txns_count) over (order by day) as cumulative_txns_count,
    sum(users_count) over (order by day) as cumulative_users_count
    from optimism.core.fact_event_logs
    join optimism.core.dim_labels
    on address = contract_address
    where block_timestamp >= date('2022-12-01')
    and label_type in ('defi', 'dex')
    and tx_status = 'SUCCESS'
    group by 1, 2
    order by 1
    Run a query to Download Data