LTirrell2022-04-21_terra_votes_backup
Updated 2022-04-22
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
35
36
›
⌄
with non_val_voters as (
select
date_trunc('day', block_timestamp) as datetime,
voter,
proposal_id,
case
when option in ('Yes', 'VOTE_OPTION_YES') then 'Yes'
when option in ('No', 'VOTE_OPTION_NO') then 'No'
when option in ('Abstain', 'VOTE_OPTION_ABSTAIN') then 'Abstain'
when option in ('NoWithVeto', 'VOTE_OPTION_NO_WITH_VETO') then 'NoWithVeto'
end as option,
-- voting_power, -- not using, empty a lot of the time
tx_id
from
terra.gov_vote
where
voter_address_name is null
),
voting_power as (
select
date,
address,
balance
from
terra.daily_balances
where
currency = 'LUNA'
and balance_type = 'staked'
and balance > 0
and address in (
select
distinct voter
from
non_val_voters
)
and date in (
Run a query to Download Data