sarathinfamous82-7
Updated 2022-12-12
999
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
35
36
›
⌄
with validator_addresses_tb as (
select
raw_metadata[0]:"account_address"::string as validator_address
from osmosis.core.dim_labels
where label_subtype = 'validator'
),
first_time_voters_tb as (
select
'First time voters' as type,
min(block_timestamp) as min_date,
voter
from osmosis.core.fact_governance_votes
where tx_status = 'SUCCEEDED'
group by voter
),
first_time_voter_on_82 as (
select
'First time voter (Proposal #82)' as type,
v.voter
from osmosis.core.fact_governance_votes v JOIN first_time_voters_tb f on v.block_timestamp = f.min_date and v.voter = f.voter
where tx_status = 'SUCCEEDED'
AND proposal_id = '82'
group by 2
),
final_tb as (
select
'Normal voter' as type,
case
when vote_option = 1 then 'YES'
when vote_option = 2 then 'ABSTAIN'
when vote_option = 3 then 'NO WITH VETO'
when vote_option = 4 then 'NO'
END as vote_type,
sum(vote_weight) as votes
from osmosis.core.fact_governance_votes
where proposal_id = '82'
Run a query to Download Data