Skip to content
Dune Analytics

@slash125 / top 5 ETH exercised options

SQL query

1WITH eth as (SELECT id, profit/10^18 as gross_eth, price, profit/10^18*price as gross_usd, evt_tx_hash as tx_hash from hegic."HegicETHOptions_evt_Exercise"
2JOIN prices."usd" p on p.minute = date_trunc('minute', hegic."HegicETHOptions_evt_Exercise".evt_block_time)
3WHERE symbol = 'WETH'
4)
5
6SELECT cast(e.id as int) as id, (gross_eth - (c."totalFee"/10^18)) as "ETH profit", cast((gross_eth - (c."totalFee"/10^18)) * price as int) as "$ profit", e.tx_hash as "tx exercise" from eth as e
7JOIN hegic."HegicETHOptions_evt_Create" as c on e.id=c.id
8ORDER BY "ETH profit" DESC
9LIMIT 5

SQL query results

Loading