Skip to content
Dune Analytics

@slash125 / writeWBTC/writeETH liquidity

SQL query results

Loading
 

SQL query

1WITH eth_liq as (with inn as (SELECT sum(value/10^18) as "sum", '1' as id from hegic."HegicETHPool_call_provide" p
2JOIN ethereum."transactions" t on p.call_tx_hash = t.hash
3WHERE call_success = true),
4
5out as (
6SELECT 
7sum(-value/10^18) as "sum", '1' as id
8 from hegic."HegicETHPool_call_withdraw" w
9JOIN ethereum."traces" t on w.call_tx_hash = t.tx_hash
10WHERE success = true
11),
12
13TOTAL as (
14SELECT "sum", id from inn
15UNION 
16SELECT "sum", id
17 from out)
18 
19 SELECT sum("sum") as "writeETH", sum("sum") * (SELECT price FROM prices.usd
20WHERE symbol = 'WETH'
21ORDER BY minute DESC
22LIMIT 1) as "USD value", '1' as id from total ),
23
24total AS
25  (SELECT DAY,...