freemartian90 Top 20 Governance Protocol of Regular Voters
Updated 2023-05-10
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
34
35
36
›
⌄
-- forked from 855e82ea-1f62-4d70-977a-d25278aad6f5
with delegatees AS (
SELECT
decoded_log:delegatee AS Delegatee,
count(distinct decoded_log:delegator) AS delegated_wallets
FROM ethereum.core.fact_decoded_event_logs
WHERE contract_address = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'
AND event_name in ('DelegateChanged')
GROUP BY delegatee
HAVING delegated_wallets > 2
),
delegate_votes AS (
SELECT
voter
FROM ethereum.aave.ez_votes
WHERE voter IN (SELECT delegatee FROM delegatees)
AND block_timestamp > current_date - 90
),
regular_votes AS(
SELECT
voter
FROM ethereum.aave.ez_votes
WHERE voter NOT IN (SELECT delegatee FROM delegatees)
AND block_timestamp > current_date - 90
)
SELECT
space_id AS protocol,
count(id) AS count
FROM ethereum.core.ez_snapshot
WHERE voter IN (SELECT voter FROM regular_votes)
GROUP BY space_id
Run a query to Download Data