nsa2000stake unstake on sol
    Updated 2022-11-22
    ---this code is thankfully burrowed from alik110: https://app.flipsidecrypto.com/dashboard/Dw-8BN
    select block_timestamp::date as date,
    case when date >= '2022-11-08' then 'After FTX Collapse'
    else 'Before FTX Collapse' end as timespan,
    case when action ilike '%deposit%' or action ilike 'claim' then 'Stake/Deposit/Claim Rewards'
    when action ilike '%withdraw%' or action ilike 'order_unstake' then 'Unstake/Withdraw/Order to Unstake'
    else null end as action_type,
    count (distinct tx_id) as TX_Count,
    count (distinct address) as Users_Count,
    sum (amount/1e9) as Total_Volume,
    avg (amount/1e9) as Average_Volume
    from solana.core.fact_stake_pool_actions
    where succeeded = 'TRUE'
    and block_timestamp >= CURRENT_DATE - 21
    and action_type is not null
    group by 1,2,3
    Run a query to Download Data