Salehl-g -group voting
    Updated 2022-08-02
    with votes as (
    select
    parse_json(ARGS):id as proposal_id
    -- ,parse_json(ARGS):vote as result
    -- ,count(DISTINCT tx_hash) as voting_count
    ,tx_hash as tx_id
    from near.core.fact_actions_events_function_call
    -- where tx_hash='6jvmPhVXN1pKsF2zxCieQHWWUJnhgS2nMo9LQfrRs3fn'
    where METHOD_NAME='vote'
    and ARGS ilike '%vote%'
    group by 1,2

    )
    select
    TX_SIGNER
    ,proposal_id
    ,count(DISTINCT tx_hash) as votes_count
    from near.core.fact_transactions ft
    -- where tx_hash='64wMz5zWrkMdqoy1u5ogkeShn5LZuJgK7BpJkMfc7i2t'
    join votes on votes.tx_id = ft.tx_hash
    -- and TX_SIGNER ilike '%pool%'
    group by 1,2
    -- order by tx_id DESC

    Run a query to Download Data