tubaecciVotes
Updated 2024-10-09
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
›
⌄
-- forked from Votes Over Time @ https://flipsidecrypto.xyz/studio/queries/955cdb8c-7b0c-48e6-be23-9e953d39699e
WITH votes AS(
SELECT
block_timestamp,
tx_hash,
decoded_log,
decoded_log:reason :: STRING AS reason,
decoded_log:support AS support,
decoded_log:voter :: STRING AS voter,
decoded_log:weight / POW(10, 18) AS weight
FROM arbitrum.core.ez_decoded_event_logs
WHERE contract_address = '0x789fc99093b09ad01c34dc7251d0c89ce743e5a4'
AND decoded_log:proposalId = '70429238801539452185774644949439873171403711884919863798646613157877144482819'
AND event_name = 'VoteCast'
AND tx_status = 'SUCCESS'
)
SELECT
CASE WHEN support = 1 THEN 'FOR'
WHEN support = 0 THEN 'AGAINST'
ELSE 'ABSTAIN' END AS choice,
COUNT(DISTINCT voter) AS voters,
ROUND(SUM(weight), 2) AS votes
FROM votes
GROUP BY 1
QueryRunArchived: QueryRun has been archived