Yousefi_1994 Governance Grind - Compare Daily Votes
    Updated 2023-01-24
    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
    ),
    terra_validator_list as (
    select
    address,
    label
    from terra.core.dim_address_labels
    where label_type = 'operator'
    and label_subtype = 'validator'
    ),
    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
    block_timestamp::date as "Days",
    case
    when proposal_id in (select proposal_id from last_5_proposal) then 'Last 5 Proposal'
    else 'Other Proposal'
    end as "Type",
    count(distinct tx_id) as "Number of Votes",
    count(distinct voter) as "Number of Voters"
    from governance_votes_transactions
    Run a query to Download Data