Skip to content
Dune Analytics

@0xBoxer / PJar 0.88 DAI Value in JAR (not at 100% yet)

Pjar 0.88 Units of Dai Locked (experimental, not working 100% yet, different scale)PJar 0.88 DAI Value in JAR (not at 100% yet)

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

1SELECT 
2    b.hour,
3    (sum(dDAI) over (order by HOUR asc) + sum(wDAI) over (order by HOUR asc))*b.price as DAI_in_JAR,  --+ because values are negative already
4    sum(dDAI) over (order by HOUR asc) + sum(wDAI) over (order by HOUR asc) as units_of_dai
5FROM 
6    --b start
7    (SELECT 
8    t.HOUR,
9    sum(coalesce(j.dDAI,0)) as ddai,
10    sum(coalesce(j.wDAI,0)) as wdai,
11    p.price
12        FROM 
13-- Create timebase
14    --t start
15                    (select date_trunc('HOUR', time) as HOUR
16                    from ethereum."blocks"
17                    Where date_trunc('HOUR', time) >= '2020-10-01'
18                    group by hour
19                    order by HOUR asc) t
20    --t end
21-- DAI in JAR
22    --j start
23        LEFT JOIN (
24                    SELECT  date_trunc('HOUR', evt_block_time) as HOUR,
25                    CASE    WHEN "to" = '\x6949Bb624E8e8A90F87cD2058139fcd77D2F3F87' THEN value/1e+18
...

SQL query results

Loading