jkhuhnke11Summary Table
Updated 2023-11-07
999
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
›
⌄
WITH user_delegations AS (
SELECT
delegator,
current_delegate,
current_voting_power
FROM
(
SELECT
block_number,
block_timestamp,
tx_hash,
delegator,
from_delegate AS old_delegate,
to_delegate AS current_delegate,
raw_new_balance as current_voting_power,
DENSE_RANK() OVER (
PARTITION BY delegator ORDER BY block_timestamp DESC
) AS rank
FROM "OPTIMISM"."CORE"."FACT_DELEGATIONS"
WHERE status = 'SUCCESS'
)
WHERE rank = 1
),
grp AS (
SELECT
LOWER(voter) as delegate,
voting_power AS voting_power
FROM ETHEREUM.CORE.EZ_SNAPSHOT
WHERE space_id = 'opcollective.eth'
QUALIFY(ROW_NUMBER() over(PARTITION BY voter
ORDER BY
vote_timestamp DESC)) = 1
),
Run a query to Download Data