nsa2000os2
Updated 2022-11-23Copy Reference Fork
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
30
31
32
33
34
›
⌄
-- this code is thankfully burrowed from alik110: https://app.flipsidecrypto.com/dashboard/MIXbqK
with validatorst as (
select address as validator_address,
label as validator_name,
raw_metadata[0]['account_address']::string as Account_Address,
raw_metadata[0]['rank']::string as Rank,
raw_metadata[0]['uptime']['address']::string as Proposer
from osmosis.core.dim_labels
where label_subtype = 'validator')
select 'Regular Voters' as type,
description,
count (distinct tx_id) as Votes_Count
from osmosis.core.fact_governance_votes t1 join osmosis.core.dim_vote_options t2 on t1.vote_option = t2.vote_id
where proposal_id in ('362')
and tx_status = 'SUCCEEDED'
and voter not in (select Account_Address from validatorst)
group by 1,2
union ALL
select 'Voter Validators' as type,
description,
count (distinct tx_id) as Votes_Count
from osmosis.core.fact_governance_votes t1 join osmosis.core.dim_vote_options t2 on t1.vote_option = t2.vote_id
where proposal_id in ('362')
and tx_status = 'SUCCEEDED'
and voter in (select Account_Address from validatorst)
group by 1,2
Run a query to Download Data