Skip to content
Dune Analytics

@hagaetc / Collateral USD value per day

Collateral USD value 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

1WITH days AS (
2    SELECT generate_series('2019-11-12'::timestamp, date_trunc('day', NOW()), '1 day') AS day
3    )
4
5, addresses(adr) AS (
6    
7    SELECT address AS adr FROM makermcd."collateral_addresses"
8    
9), transfers AS (
10    SELECT day, token_address, 
11    sum(amount) AS amount
12    FROM (
13        SELECT  date_trunc('day', evt_block_time) AS day,
14                tr.contract_address AS token_address,
15                value AS amount
16        FROM erc20."ERC20_evt_Transfer" tr
17        WHERE "to" IN (SELECT address FROM makermcd."collateral_addresses")
18        AND evt_block_time > '2019-11-12'
19
20        UNION ALL
21        
22        SELECT  date_trunc('day', evt_block_time) AS day,
23                tr.contract_address AS token_address,
24                -value AS amount
25        FROM erc20."ERC20_evt_Transfer" tr...

SQL query results

Loading