Yousefi_1994 Governance Grind - Total Votes
Updated 2023-01-25Copy 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
›
⌄
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
and proposal_id in (select proposal_id from last_5_proposal)
)
select
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
Run a query to Download Data