Skip to content
Dune Analytics

@slash125 / cumulative options volume

SQL query

1WITH mint_eth AS (
2SELECT amount / 10^18 AS total, call_block_time as time, call_tx_hash from hegic."HegicETHOptions_call_create"
3WHERE call_success = true
4ORDER by time DESC
5),
6
7mint_btc AS (
8
9SELECT amount / 10^8 AS total, call_block_time as time, call_tx_hash from hegic."HegicWBTCOptions_call_create"
10WHERE call_success = true
11ORDER by time DESC
12),
13
14eth_price as (
15SELECT sum(total * price) as price_eth, '1' as id2  from mint_eth
16JOIN prices."usd" p ON p.minute = date_trunc('minute',mint_eth.time)
17WHERE p.symbol = 'WETH'
18AND minute > '10/10/20 00:00'),
19
20wbtc_price as (
21
22SELECT sum(total * price) as price_btc, '1' as id  from mint_btc
23JOIN prices."usd" p ON p.minute = date_trunc('minute',mint_btc.time)
24WHERE p.symbol = 'WBTC'
25AND minute > '10/10/20 00:00'),...

SQL query results

Loading