kiacryptoNumber of votes and unique voters
    Updated 2023-02-25
    with votes as (
    select
    date_trunc('day', block_timestamp) as date,
    count(distinct tx_id) as votes_count,
    (select count(distinct tx_id) from cosmos.core.fact_msg_attributes where attribute_key = 'proposal_id' and attribute_value= '93') as total_votes
    from cosmos.core.fact_msg_attributes
    where
    attribute_key = 'proposal_id' and
    attribute_value= '93'
    group by 1
    ),
    voters as (
    select
    date_trunc('day', t.block_timestamp) as day,
    count(distinct tx_from) as unique_voters,
    (select count(distinct tx_from) from cosmos.core.fact_transactions t join cosmos.core.fact_msg_attributes m on t.tx_id = m.tx_id where attribute_key = 'proposal_id' and attribute_value= '93') as total_unique_voters
    from cosmos.core.fact_transactions t join cosmos.core.fact_msg_attributes m on t.tx_id = m.tx_id
    where
    attribute_key = 'proposal_id' and
    attribute_value= '93'
    group by 1
    )
    select *
    from votes join voters on date = day
    Run a query to Download Data