select
validator_label as "Validator name",
count(distinct tx_id) as "tx count",
count(distinct delegator_address) as "Unique wallet",
sum(amount) as "Volume",
avg(amount) as "AVG volume"
from terra.core.ez_staking
where tx_succeeded = 'TRUE' and action = 'Delegate' and validator_label is not null
group by 1
order by 3 desc
limit 20