--top 10 validators
select
address,
delegator_address,
operator_address,
vp_address,
l.label,
block_id,
block_timestamp,
voting_power,
(select sum(voting_power) from terra.validator_voting_power where block_id = (select max(block_id) from terra.validator_voting_power)) as total_voting_power,
voting_power/total_voting_power * 100 as percent_voting_power
from terra.validator_voting_power v left join terra.validator_labels l on (v.address = l.vp_address)
where block_id = (select max(block_id) - 389189 from terra.validator_voting_power)
order by voting_power desc
limit 10
--select * from terra.validator_labels