Skip to content
Dune Analytics

@slash125 / WBTC LPs projected uPnL % as spot price changes

SQL query results

Loading
 

SQL query

1WITH active_btc AS
2  (WITH cre AS
3     (SELECT account,
4             call_block_time AS "Date",
5             cast(c."output_optionID" AS int) AS "ID",
6             (CASE
7                  WHEN "optionType" = '1' THEN 'put'
8                  ELSE 'call'
9              END) AS "type",
10             amount/10e7 AS "Size",
11             ("totalFee" - "settlementFee")/10e7 AS "Premium",
12             strike/10e7 AS "Strike",
13             (CASE
14                  WHEN period = 86400.00 THEN date_trunc('minute', call_block_time) + interval '1 days'
15                  WHEN period = 604800.00 THEN date_trunc('minute', call_block_time) + interval '7 days'
16                  WHEN period = 1209600.00 THEN date_trunc('minute', call_block_time) + interval '14 days'
17                  WHEN period = 1814400.00 THEN date_trunc('minute', call_block_time) + interval '21 days'
18                  ELSE date_trunc('minute', call_block_time) + interval '28 days'
19              END) AS "Expiration Date",
20             call_tx_hash AS "tx hash",
21             call_block_time
22      FROM hegic."HegicWBTCOptions_call_create" c
23      JOIN hegic."HegicWBTCOptions_evt_Create" e ON c.call_tx_hash = e.evt_tx_hash
24      WHERE call_success = TRUE ),
25        exe AS...