jp121 [LilNoun] Voting Activity - Counts
Updated 2022-06-17Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
WITH votes as (
select block_timestamp::date as date, origin_from_address as voter, tx_hash, EVENT_INPUTS:proposalId::string as proposal_id, EVENT_INPUTS:reason::string as reason, EVENT_INPUTS:support::string as vote,
EVENT_INPUTS:votes::number as num_votes
from ethereum.core.fact_event_logs
WHERE ORIGIN_TO_ADDRESS = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039' and (ORIGIN_FUNCTION_SIGNATURE IN ('0x56781388', '0x7b3c71d3') OR EVENT_NAME = 'VoteCast')
and TX_STATUS = 'SUCCESS'
)
-- SELECT *
-- FROM votes
-- WHERE num_votes > 1
SELECT date, proposal_id, SUM(num_votes) as daily_votes, COUNT(DISTINCT voter) as daily_voter
FROM votes
WHERE proposal_id IS NOT NULL
GROUP BY 1, 2
Run a query to Download Data