Skip to content
Dune Analytics

@johaya / (#4181) DAI Net Issuance

(#4181) DAI Net Issuance

Loading
 

About queries and results

Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.

We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.

Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.

SQL query results

Loading
 

SQL query

1SELECT a.mint_dt AS DAY,
2       price,
3       sum(a.wad/1e18-b.wad/1e18) AS net_outstanding
4FROM
5  (SELECT sum(wad) as wad,date(call_block_time)as mint_dt
6   FROM makermcd."DAI_call_mint"
7   WHERE call_block_time >= '2020-04-01 00:00:00'
8   and call_success='true'
9   group by 2)a
10left JOIN
11  (SELECT sum(wad) as wad,date(call_block_time) as burn_dt
12   FROM makermcd."DAI_call_burn" b
13   WHERE call_block_time >= '2020-04-01 00:00:00'
14   and call_success='true'
15   group by 2 )b ON a.mint_dt = b.burn_dt
16left JOIN
17  (SELECT avg(price) as price,date(minute) as dt
18   FROM prices."usd"
19   WHERE date(MINUTE) >= date('2020-04-01')
20   and symbol='DAI'
21   group by 2) p ON a.mint_dt = p.dt
22GROUP BY 1,
23         2
24ORDER BY 1
25