Ali3NProposal Voting Activity of SG-1 vs Game Validators
    Updated 2022-12-11
    with proposaltx as (
    select tx_id,
    attribute_value as Proposal_ID
    from cosmos.core.fact_msg_attributes
    where ATTRIBUTE_KEY= 'proposal_id'
    and tx_succeeded = 'TRUE'),

    voter as (
    select block_timestamp,
    tx_id,
    attribute_value as Voter
    from cosmos.core.fact_msg_attributes
    where ATTRIBUTE_KEY= 'spender'
    and tx_id in (select tx_id from proposaltx)
    and tx_succeeded = 'TRUE'),

    voteoption as (
    select block_timestamp,
    tx_id,
    try_parse_json (attribute_value) as data,
    data:option as vote_option,
    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_type
    from cosmos.core.fact_msg_attributes
    where ATTRIBUTE_KEY= 'option'
    and data:option is not null
    and tx_id in (select tx_id from proposaltx)
    and tx_succeeded = 'TRUE'),
    mergetable as (
    select proposal_id,
    t2.block_timestamp,
    t1.tx_id,
    Run a query to Download Data