adriaparcerisasMaker DAO governance pools bo
Updated 2022-06-29
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 token_holders AS
(
SELECT
address,
sum(amount) as holding
FROM
(
SELECT
to_address as address,
sum(raw_amount) / pow(10,18) as amount
from ethereum.core.fact_token_transfers
where contract_address = lower('0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2')
and block_timestamp <= '2022-06-27 16:00:00.000'
-- and to_address = '0x0a3f6849f78076aefadf113f5bed87720274ddc0'
group by 1
UNION
SELECT
from_address as address,
sum(-raw_amount) / pow(10,18) as amount
from ethereum.core.fact_token_transfers
where contract_address = lower('0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2')
and block_timestamp <= '2022-06-27 16:00:00.000'
-- and from_address = '0x0a3f6849f78076aefadf113f5bed87720274ddc0'
group by 1
)
group by 1
order by 2 desc
)
,
delegates as
(
SELECT
address,
Run a query to Download Data