FatemeTheLadynear cl14
    Updated 2022-11-08
    select date_trunc (week,block_timestamp) as date,
    event_type,
    case when event_type in ('delegate','activate') then 'Stake'
    when event_type in ('undelegate','deactivate','withdraw') then 'Unstake'
    when event_type like '%split%' then 'Split'
    else 'Merge' end as Action_Type,
    count (distinct tx_id) as TX_Count,
    count (distinct signers[0]) as Users_Count,
    count (distinct validator_name) as Validators_Count,
    sum ((post_tx_staked_balance - pre_tx_staked_balance)/1e9) as Volume
    from solana.core.ez_staking_lp_actions
    where succeeded = 'TRUE' and date>='2022-01-01' and date<CURRENT_DATE
    and node_pubkey is not null
    and event_type is not null
    and event_type not in ('authorize','initialize','setLockup','initializeChecked','authorizeChecked')
    group by 1,2,3
    Run a query to Download Data