bachiTerra validators
Updated 2022-03-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
›
⌄
with latestBlock as (
select address , voting_power
from terra.validator_voting_power
where block_id = (
select max(block_id) from terra.validator_voting_power
)
),
valiDators as(
select vp_address, label
from terra.validator_labels
),
totalDelegation as(
select sum(voting_power) as total
from latestBlock
),
labeledValidators as(
select latestBlock.address, latestBlock.voting_power, valiDators.label
from latestBlock
left outer join valiDators on latestBlock.address=valiDators.vp_address
)
select
label,
voting_power,
ROUND(((voting_power/total)*100),1) || '%' AS percentage--,
--sum((voting_power/total)*100) over (partition by total) as cumSum
from labeledValidators, totalDelegation
order by 2 desc
--limit 10
Run a query to Download Data