Skip to content
Dune Analytics

@slash125 / USD cumulative settlement fees collected by Hegic Protocol

USD cumulative settlement fees collected by Hegic Protocol

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 eth AS
2  ( SELECT date_trunc('day', evt_block_time) AS DAY,
3           sum("settlementFee"/10^18) OVER (
4                                            ORDER BY date_trunc('day', evt_block_time) ASC ROWS BETWEEN unbounded preceding AND CURRENT ROW) AS "sum"
5   FROM hegic."HegicETHOptions_evt_Create" c --  JOIN hegic."HegicETHOptions_evt_Create" h ON tmp.call_tx_hash = h.evt_tx_hash
6 ),
7     eth_merge AS
8  (SELECT DISTINCT date_trunc('day', DAY) AS DAY,
9                   "sum",
10                   "sum" *
11     (SELECT price
12      FROM prices.usd
13      WHERE symbol = 'WETH'
14      ORDER BY MINUTE DESC
15      LIMIT 1) AS eth_usd_value
16   FROM eth),
17     wbtc AS
18  (SELECT date_trunc('day', evt_block_time) AS DAY,
19          sum("settlementFee"/10^8) OVER (
20                                          ORDER BY date_trunc('day', evt_block_time) ASC ROWS BETWEEN unbounded preceding AND CURRENT ROW) AS "sum"
21   FROM hegic."HegicWBTCOptions_evt_Create"),
22     wbtc_merge AS
23  (SELECT DISTINCT date_trunc('day', DAY) AS DAY,
24                   "sum",
25                   "sum" *...

SQL query results

Loading