Skip to content
Dune Analytics

@slash125 / writeWBTC LP realized PnL %

writeWBTC LP realized PnL %

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

1WITH cre_ex AS
2  (SELECT e.id,
3          e.profit / 10^8 AS win,
4          e.evt_block_time AS BLOCK,
5          c."totalFee" / 10^8 AS paid,
6          ((c."totalFee"- c."settlementFee") / 10^8) - (e.profit / 10^8) AS "net vs exercised"
7   FROM hegic."HegicWBTCOptions_evt_Exercise" e
8   LEFT JOIN hegic."HegicWBTCOptions_evt_Create" c ON e.id = c.id),
9     exp AS
10  (SELECT e.id AS id,
11          NULL AS win,
12          e.evt_block_time AS BLOCK,
13          NULL AS paid,
14          (c."totalFee" - c."settlementFee") /10^8 AS "net vs expired"
15   FROM hegic."HegicWBTCOptions_evt_Expire" e
16   LEFT JOIN hegic."HegicWBTCOptions_evt_Create" c ON e.id=c.id),
17     total AS
18  (SELECT "net vs exercised" AS net,
19          BLOCK
20   FROM cre_ex
21   UNION ALL SELECT "net vs expired" AS net,
22                    BLOCK
23   FROM exp
24   ORDER BY BLOCK DESC),
25     grouped AS...