Yousefi_1994 Governance Grind - Total Votes
    Updated 2023-01-25
    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