select case when action in ('DelegatorTokensCommitted','TokensCommitted') then 'Stake'
when action in ('DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn') then 'Unstake'
when action in ('DelegatorRewardTokensWithdrawn','RewardTokensWithdrawn') then 'Claim Reward' end as action_type,
case when amount < 5 then 'Less Than 5 FLOW'
when amount >= 5 and amount < 10 then '5 - 10 FLOW'
when amount >= 10 and amount < 100 then '10 - 100 FLOW'
when amount >= 100 and amount < 1000 then '100 - 1000 FLOW'
else 'More Than 1000 FLOW' end as volume_type,
count (distinct tx_id) as TX_Count
from flow.core.ez_staking_actions
where tx_succeeded = 'TRUE'
group by 1,2
order by 3 desc