jackguyGovernance Reaction to Terra
    Updated 2022-05-22
    with id as (
    select block_timestamp::date as date,
    attribute_value as proposal,
    row_number() over(partition by proposal order by date) as day,
    tx_id
    from osmosis.core.fact_msg_attributes
    where msg_type = 'proposal_vote' and attribute_key = 'proposal_id'
    and attribute_value between 222 and 227
    ),

    vote as (
    select tx_id,
    count(try_parse_json(attribute_value):option) as votes
    from osmosis.core.fact_msg_attributes
    where msg_type = 'proposal_vote' and attribute_key = 'option'
    group by 1
    )
    select
    date,
    proposal,
    sum(VOTES),
    count(*)
    from id
    join vote
    on id.tx_id = vote.tx_id
    where date > CURRENT_DATE - 14
    GROUP BY 1,2
    Run a query to Download Data