-- forked from Percentage of Tx Count per Node Validators @ https://flipsidecrypto.xyz/edit/queries/6ac4a634-72b9-48d0-99e3-c057582c8f09
select
node_id,
count(distinct tx_id) as TX_Count,
row_number() over (order by TX_Count DESC) as rank,
rank || '. ' || left(node_id, 4) || '...' || right(node_id, 4) as validator,
count(distinct delegator) as Users_Count,
sum(amount) as Total_Volume
from flow.core.ez_staking_actions
where tx_succeeded = 'TRUE'
group by 1