rajsDaily Votes
    Updated 2023-01-24
    with latest_proposals as
    (
    SELECT
    proposal_id,
    count(*) as no_of_votes,
    count(distinct voter) as no_of_voters,
    min(block_timestamp),
    max(block_timestamp)
    from terra.core.fact_governance_votes
    where tx_succeeded
    group by 1
    order by 5 desc
    limit 5
    )

    SELECT
    date_trunc('day', block_timestamp) as date,
    proposal_id::text as proposal_id,
    vote_option_text,
    count(distinct tx_id) as no_of_votes,
    count(distinct voter) as no_of_voters
    from terra.core.fact_governance_votes
    where proposal_id in (select proposal_id from latest_proposals)
    group by 1,2,3
    order by 1
    Run a query to Download Data