rahoaave onchain total for/against/sum
Updated 2023-04-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 allv as (
select
date(block_timestamp) as Date,
proposal_id as Proposal,
support as Support,
voting_power / pow(10, 18) as VP,
voter as Voter
from ethereum.aave.ez_votes
),
sumz as (
select
Proposal,
count(distinct voter) as num_voters,
sum(VP) as total_vp
from allv
group by 1
),
tot_for as (
select
Proposal,
count(distinct voter) as num_voters_for,
sum(VP) as total_vp_for
from allv
where Support = 'True'
group by 1
),
combined as (
select
*
from sumz
left join tot_for using(Proposal)
order by Proposal desc
)
Run a query to Download Data