mo115Voters
    Updated 2022-06-21
    With F as (with votes as (select ORIGIN_FROM_ADDRESS as voter, sum(EVENT_INPUTS:votes) as votes
    from ethereum.core.fact_event_logs
    where CONTRACT_ADDRESS = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'
    and EVENT_NAME = 'VoteCast'
    group by 1)
    select voter, votes
    from votes
    where votes>0
    order by 2 DESC),
    G as ((with A as (select NFT_FROM_ADDRESS as wallets, count (TOKENID) as sold
    from ethereum.core.ez_nft_transfers
    where NFT_ADDRESS ='0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b'
    and EVENT_TYPE ='other'
    group by 1),
    B as (select NFT_TO_ADDRESS as wallets , count (TOKENID) as received
    from ethereum.core.ez_nft_transfers
    where NFT_ADDRESS ='0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b'
    group by 1)
    select b.wallets, (received-sold) as Nfts
    from B b inner join A a on b.wallets=a.wallets
    where Nfts > '0')
    UNION
    (with A as (select NFT_FROM_ADDRESS as wallets, count (TOKENID) as sold
    from ethereum.core.ez_nft_transfers
    where NFT_ADDRESS ='0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b'
    and EVENT_TYPE ='other'
    group by 1),
    B as (select NFT_TO_ADDRESS as wallets , count (TOKENID) as received
    from ethereum.core.ez_nft_transfers
    where NFT_ADDRESS ='0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b'
    group by 1)
    select b.wallets, (received) as Nfts
    from B b left join A a on b.wallets=a.wallets
    where a.wallets is null)
    order by nfts DESC)
    select VOTER,VOTES,nfts , (nfts-VOTES) as changes,
    Run a query to Download Data