Skip to content
Dune Analytics

@tianqi / Fork of (#977) Dai Outstanding per day

Fork of (#977) Dai Outstanding per day

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

1WITH erc20 AS
2  ( SELECT date_trunc('day', call_block_time) AS DAY,
3           SUM(erc20_amount) AS erc20_amount
4   FROM (
5           (SELECT call_block_time,
6                   wad/1e18 AS erc20_amount
7            FROM makermcd."DAI_call_mint" m
8            WHERE m.call_success )
9         UNION ALL
10           (SELECT call_block_time, -wad/1e18 AS erc20_amount
11            FROM makermcd."DAI_call_burn" m
12            WHERE m.call_success )) t
13   GROUP BY 1),
14     dsr AS
15  ( SELECT date_trunc('day', call_block_time) AS DAY,
16           SUM(dsr_amount) AS dsr_amount
17   FROM (
18           (SELECT call_block_time, -rad/1e45 AS dsr_amount
19            FROM makermcd."VAT_call_move" m
20            WHERE m.call_success
21              AND src = '\x197e90f9fad81970ba7976f33cbd77088e5d7cf7' )
22         UNION ALL
23           (SELECT call_block_time,
24                   rad/1e45 AS dsr_amount
25            FROM makermcd."VAT_call_move" m...