Skip to content
Dune Analytics

@slash125 / ETH historical options

SQL query results

Loading
 

SQL query

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