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,
    ATTRIBUTE_VALUE
    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,
    b.ATTRIBUTE_VALUE as id,
    a.TX_ID,
    a.ATTRIBUTE_VALUE as voter
    from cosmos.core.fact_msg_attributes a
    join votes b
    on a.tx_id=b.tx_id
    Run a query to Download Data