Yousefi_1994 Governance Grind - Parametric Daily Votes
Updated 2023-01-25
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 fix_parameter as (
select
case
when '{{Proposal }}' = 'Proposal #3619' then '3619'
when '{{Proposal }}' = 'Proposal #3665' then '3665'
when '{{Proposal }}' = 'Proposal #3794' then '3794'
when '{{Proposal }}' = 'Proposal #3795' then '3795'
when '{{Proposal}}' = 'Proposal #3796' then '3796'
else '3619'
end as proposals,
split(proposals, ',') as proposals_id_array
),
last_5_proposal as (
select
proposal_id
from terra.core.fact_governance_votes
where proposal_id in (3619, 3665, 3794, 3795, 3796)
group by proposal_id
order by proposal_id desc
limit 5
),
governance_votes_transactions as (
select
tx_id,
block_timestamp,
voter,
proposal_id,
vote_option_text
from terra.core.fact_governance_votes, fix_parameter
where tx_succeeded = true
and proposal_id ilike any (proposals_id_array[0], proposals_id_array[1],
proposals_id_array[2], proposals_id_array[3],
proposals_id_array[4])
)
select
Run a query to Download Data