Skip to content
Dune Analytics

@slash125 / ETH active options

SQL query results

Loading
 

SQL query

1WITH active as (
2
3
4WITH cre as (SELECT account, 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/10e17 AS "Size",
11          "totalFee"/10e17 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
22FROM hegic."HegicETHOptions_call_create" c
23JOIN hegic."HegicETHOptions_evt_Create" e ON c.call_tx_hash = e.evt_tx_hash
24WHERE call_success = true
25),...