Yousefi_1994 Governance Grind - Compare Total Votes
Updated 2023-01-24Copy 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
›
⌄
with last_5_proposal as (
select
proposal_id
from terra.core.fact_governance_votes
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
where tx_succeeded = true
)
select
case
when proposal_id in (select proposal_id from last_5_proposal) then 'Last 5 Proposal'
else 'Other Proposal'
end as "Type",
vote_option_text as "Vote Option",
count(distinct proposal_id) as "Number of Proposal",
count(distinct tx_id) as "Number of Votes",
count(distinct voter) as "Number of Voters",
round("Number of Votes" / "Number of Proposal") as "Average Vote per Proposal",
round("Number of Voters" / "Number of Proposal") as "Average Voters per Proposal"
from governance_votes_transactions
group by "Type", "Vote Option"
Run a query to Download Data