Sbhn_NPstaking opti
    Updated 2023-01-15
    with main as (select date_trunc('day',block_timestamp) as date,
    case when block_timestamp < '2022-12-24' then 'Before Holidays' when block_timestamp < '2023-01-01' then 'Holidays' else 'After Holidays' end as timeframe,
    delegation_type as type,
    count (distinct tx_hash) as Transactions,
    count(DISTINCT DELEGATOR) as users
    from optimism.core.fact_delegations
    where status = 'SUCCESS'
    and block_timestamp >= '2022-12-15'
    group by 1,2,3)

    select date,
    timeframe,
    type,
    Transactions,
    users
    from main
    Run a query to Download Data