Skip to content
Dune Analytics

@amcassetti / [REN] renBTC $ Volume Per Day

[REN] renBTC $ Volume 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

1--Fork of https://explore.duneanalytics.com/public/dashboards/wp6f0NCQWOQLdLNTqq9pdt1G3lDf0ehorHhB6AgA
2
3with renBTC AS
4    (SELECT gross.day, SUM(transfer*price) as renBTC$
5    FROM (  SELECT 
6                date_trunc('day', evt_block_time) as day,
7                sum(value/1e8) as transfer
8            FROM erc20."ERC20_evt_Transfer"
9            WHERE contract_address = '\xeb4c2781e4eba804ce9a9803c67d0893436bb27d' -- renBTC token contract address
10                AND "from" = '\x0000000000000000000000000000000000000000'
11            GROUP BY 1
12        UNION
13            SELECT
14                date_trunc('day', evt_block_time) as day,
15                sum(value/1e8) as transfer
16            FROM erc20."ERC20_evt_Transfer"
17            WHERE contract_address = '\xeb4c2781e4eba804ce9a9803c67d0893436bb27d' -- renBTC token contract address
18                AND "to" = '\x0000000000000000000000000000000000000000'
19            GROUP BY 1) as gross
20    JOIN (  SELECT 
21                date_trunc('day', minute) as day, 
22                avg(price) as price 
23            FROM prices."usd_btc"
24            GROUP BY 1 ) as prices
25    ON prices.day = gross.day...