adambalaVoting Activity
    Updated 2022-06-22
    select
    ID_propal,vote,count(distinct ORIGIN_FROM_ADDRESS) as wallets,datee ,av_gas
    from (
    with gas
    as
    (select
    date_trunc('day', block_timestamp) as datee,
    avg(gas_price)/1e9 as av_gas
    from ethereum.transactions
    where block_timestamp >=getdate() - interval '300 days'
    group by 1 having av_gas <500
    order by 1)

    select EVENT_INPUTS:proposalId as ID_propal ,
    count(distinct EVENT_INPUTS:votes) as vote ,
    ORIGIN_FROM_ADDRESS ,
    datee ,av_gas
    from ethereum.core.fact_event_logs lg inner join gas
    on block_timestamp::date =datee
    where EVENT_NAME='VoteCast'
    and CONTRACT_ADDRESS=('0x5d2c31ce16924c2a71d317e5bbfd5ce387854039' ) group by 1,3,4,5 having vote between 1 and 3 )
    where vote between 0 and 3
    group by 1,2,4,5


    Run a query to Download Data