KARTODTotal DAI mint amount
Updated 2022-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 DAI_mint_burn_raw as (
select
tx_id,
block_timestamp,
amount
from ethereum.udm_events
where contract_address = '0x6b175474e89094c44da98b954eedeac495271d0f'
and from_address = '0x0000000000000000000000000000000000000000'
union all
select
tx_id,
block_timestamp,
-amount as amount
from ethereum.udm_events
where contract_address = '0x6b175474e89094c44da98b954eedeac495271d0f'
and to_address = '0x0000000000000000000000000000000000000000'
),
DAI_mint_burn as (
select
date_trunc('day', block_timestamp) as blocktime,
sum(case when amount > 0 then amount else 0 end) as mint_amount,
sum(case when amount < 0 then amount else 0 end) as burn_amount,
sum(amount) as net_mint_amount
from DAI_mint_burn_raw
group by blocktime
),
BTC_price AS (
SELECT
date_trunc('day',hour) as days,
symbol,
token_address,
avg(price) as price
FROM ethereum.token_prices_hourly
WHERE hour >= CURRENT_DATE() - interval'300 day'
Run a query to Download Data