Yousefi_1994Proposal 362 - Daily Votes
    Updated 2022-11-24
    with osmosis_validator_list as (
    select
    raw_metadata[0]:account_address as address,
    label
    from osmosis.core.dim_labels
    where label_type = 'operator'
    and label_subtype = 'validator'
    ),
    proposal_362_governance_votes as (
    select
    block_timestamp,
    tx_id,
    voter,
    vote_option,
    vote_weight
    from osmosis.core.fact_governance_votes votes
    where proposal_id = 362
    and tx_status = 'SUCCEEDED'
    )

    select
    block_timestamp::date as "Days",
    date_trunc('hour', block_timestamp) as "Hour",
    case
    when vote_option = 1 then 'YES'
    when vote_option = 2 then 'ABSTAIN'
    when vote_option = 3 then 'NO'
    when vote_option = 4 then 'NO WITH VETO'
    end as "Vote Option",
    case
    when voter in (select address from osmosis_validator_list) then 'Vote by Validators'
    else 'Vote by Others'
    end as "Voter Type",
    count(distinct tx_id) as "Number of Votes",
    count(distinct voter) as "Number of Voters"
    from proposal_362_governance_votes
    Run a query to Download Data