jkhuhnke11AAVE - Stagnant Voters
Updated 2023-05-13
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
›
⌄
WITH monthly_v AS (
SELECT
voter,
max(vote_timestamp :: date) as date
FROM ethereum.core.ez_snapshot
WHERE space_id = 'aave.eth'
GROUP BY voter, voting_power
UNION
SELECT
voter,
max(block_timestamp :: date) AS date
FROM ethereum.aave.ez_votes
GROUP BY voter, voting_power
),
bals AS (
SELECT
v.voter,
date,
t.voting_power / POW(10, 18) + s.voting_power as vp
FROM monthly_v v
LEFT OUTER JOIN ethereum.aave.ez_votes t
ON v.voter = t.voter
AND v.date = t.block_timestamp :: date
LEFT OUTER JOIN ethereum.core.ez_snapshot s
ON v.voter = s.voter
AND v.date = s.vote_timestamp :: date
),
voted AS (
SELECT
sum(vp) AS vt
FROM bals
WHERE date > CURRENT_DATE - 30
),
last_30 AS (
Run a query to Download Data