AshlyCryptotop 10 voters
    Updated 2023-02-16
    with

    terra_tab as (
    select
    DISTINCT PROPOSAL_ID
    from terra.core.fact_transactions a
    join terra.core.fact_governance_submit_proposal b
    on a.tx_id = b.tx_id
    where a.TX_SUCCEEDED and
    ( tx:body:messages[0]:content:title like '%grant%' or tx:body:messages[0]:content:title like '%Grant%')
    ),
    votes as (
    select
    voter,
    --count( DISTINCT PROPOSAL_ID) as prop_count,
    VOTE_OPTION_TEXT,
    count(DISTINCT TX_ID) as total_votes,
    round(
    (total_votes * 100) / SUM(total_votes) OVER (
    partition by
    voter
    ),
    2
    ) as perc
    from
    terra.core.fact_governance_votes
    where
    TX_SUCCEEDED and PROPOSAL_ID in (select * from terra_tab)
    group by
    1,
    2
    ),

    topv as (

    select
    Run a query to Download Data