select top 20 delegator
,count(DISTINCT tx_id) tx_count
,sum(amount) total_amount
,row_number() over (order by total_amount desc) row_num
from flow.core.ez_staking_actions
where tx_succeeded = 'TRUE'
and action in ('DelegatorTokensCommitted','TokensCommitted')
group by 1
order by 3 desc