adriaparcerisasHistorical chart of a MakerDAO vote on poll 819
Updated 2022-06-29Copy Reference Fork
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
date,
address,
sum(amount) as holding
FROM
(
SELECT
trunc(block_timestamp,'hour') as date,
to_address as address,
sum(raw_amount) / pow(10,18) as minute_amount,
sum(minute_amount) over (partition by address order by date) 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,2
UNION
SELECT
trunc(block_timestamp,'hour') as date,from_address as address,
sum(-raw_amount) / pow(10,18) as minute_amount,
sum(minute_amount) over (partition by address order by date) 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,2
)
group by 1,2
order by 1 asc,3 desc
)
,
Run a query to Download Data