kidaValidator vote histories
    Updated 2022-11-19
    select
    last_change,
    last_tx_id,
    voter,
    label,
    last_vote,
    max(vote_weight) as vote_weight,
    listagg(vote_cast, ' ➛ ') as vote_history
    from (
    select
    block_timestamp,
    tx_id,
    voter,
    label,
    raw_metadata[0]:delegator_shares / 1e6 as vote_weight,
    description as vote_cast,
    last_value(block_timestamp) over (partition by voter order by block_timestamp) as last_change,
    last_value(tx_id) over (partition by voter order by block_timestamp) as last_tx_id,
    last_value(vote_cast) over (partition by voter order by block_timestamp) as last_vote
    from osmosis.core.fact_governance_votes g
    join osmosis.core.dim_vote_options v
    on g.vote_option = v.vote_id
    join osmosis.core.dim_labels l
    on l.raw_metadata[0]:account_address = voter
    where proposal_id = 362
    and label_subtype = 'validator'
    and raw_metadata[0]:rank <= 150
    and raw_metadata[0]:status = 3 -- active
    order by block_timestamp
    )
    where block_timestamp = last_change
    group by 1,2,3,4,5
    order by vote_weight desc
    Run a query to Download Data