Soheil_MKUntitled Query
    Updated 2022-12-11
    with op as (
    select
    VOTE_ID,
    DESCRIPTION
    from osmosis.core.dim_vote_options
    ),

    votes as (
    select

    distinct tx_id
    from cosmos.core.fact_msg_attributes
    where ATTRIBUTE_KEY = 'proposal_id'
    and ATTRIBUTE_VALUE ='82'
    ),

    options as (
    select
    distinct TX_ID,
    try_parse_json ( ATTRIBUTE_VALUE):option as opt,
    try_parse_json ( ATTRIBUTE_VALUE):weight as weight
    from cosmos.core.fact_msg_attributes a
    where tx_id in (select tx_id from votes)
    and ATTRIBUTE_KEY ='option'
    ),

    voters as (
    select
    BLOCK_TIMESTAMP,
    TX_ID,
    ATTRIBUTE_VALUE as voter
    from cosmos.core.fact_msg_attributes
    where tx_id in (select tx_id from votes)
    and MSG_TYPE ='transfer'
    and ATTRIBUTE_KEY='sender'
    ),
    Run a query to Download Data