Updated 2022-11-15

    SELECT date_trunc('day' , BLOCK_TIMESTAMP) as weekly , sum(case
    when ACTION like '%Stake%' THEN (STAKE_AMOUNT)
    when ACTION like '%Unstake%' THEN -(STAKE_AMOUNT) end
    ) *power(10,-24) as volume ,
    case
    when weekly BETWEEN '2022-11-07' and '2022-11-13' then 'Week of 11/7 and 11/14'
    when weekly <'2022-11-07' then 'Before'
    else 'After' end as type
    from near.core.dim_staking_actions
    WHERE weekly > CURRENT_DATE -60
    GROUP by 1 ,3
    Run a query to Download Data