itsxenuxTotal fees paid by voters for proposals
    Updated 2022-07-06
    with query_first as (select event_inputs:proposalId AS id_proposal,
    Sum(event_inputs:votes) AS vote_total
    from ethereum.core.fact_event_logs
    where event_name ilike '%votecast%'
    and contract_address ilike '%0X6F3E6272A167E8ACCB32072D08E0957F9C79223D%'
    group by id_proposal),
    query_second as (select top 5 *
    from query_first
    order by vote_total desc)
    select origin_from_address as wallet_address, sum(ethereum.core.fact_transactions.tx_fee), event_inputs:proposalId as id_proposal
    from ethereum.core.fact_event_logs join ethereum.core.fact_transactions
    on ethereum.core.fact_event_logs.tx_hash = ethereum.core.fact_transactions.tx_hash
    where ethereum.core.fact_event_logs.contract_address ilike '%0X6F3E6272A167E8ACCB32072D08E0957F9C79223D%'
    and id_proposal in (select id_proposal from query_second)
    group by id_proposal,wallet_address


    Run a query to Download Data