Skip to content
Dune Analytics

@slash125 / WBTC/ETH settlement fees per week

WBTC/ETH settlement fees per week

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

1 WITH wbtc as 
2    ( SELECT date_trunc('week', (evt_block_time + interval '2 days')) as week,
3      SUM(value)/10^8  AS wbtc_settlement
4      FROM erc20."ERC20_evt_Transfer"
5      WHERE erc20."ERC20_evt_Transfer".contract_address = '\x2260fac5e5542a773aa44fbcfedf7c193bc2c599'
6      AND erc20."ERC20_evt_Transfer".to = '\x840a1AE46B7364855206Eb5b7286Ab7E207e515b'
7      AND evt_block_number > '11024342'
8      AND erc20."ERC20_evt_Transfer".from = '\x3961245DB602eD7c03eECcda33eA3846bD8723BD'
9      GROUP BY 1 ORDER BY 1
10      ),
11      
12  --  wbtc_usd as ( SELECT date_trunc('week', minute) as week1,
13    -- AVG(price) as price
14    -- FROM prices.usd
15     --WHERE symbol = 'WBTC'
16     --AND minute > '10/10/2020 00:00'
17     --GROUP BY 1 ORDER BY 1 DESC
18     --LIMIT 50),
19     
20    wbtc_merge as ( SELECT week, wbtc_settlement,  wbtc_settlement * (SELECT price from prices.usd WHERE symbol = 'WBTC' ORDER by minute DESC limit 1) as wbtc_usd_value
21     from wbtc
22),
23     
24 eth as
25    ( SELECT date_trunc('week', block_time + interval '2 days') as week1,...

SQL query results

Loading