dannerUntitled Query
Updated 2021-09-17Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
with functions as
(select
concat(origin_function_name,' ',symbol) as function_symbol,
sum(amount) amount
from
ethereum.udm_Events
where tx_id in
(select
tx_id
from
ethereum.events_emitted
where (tx_to_address = lower('0xDC24316b9AE028F1497c275EB9192a3Ea0f67022')
or tx_from_address = lower('0xDC24316b9AE028F1497c275EB9192a3Ea0f67022'))) -- sETH - ETH Pool
group by function_symbol)
select
sum(case when function_symbol ='add_liquidity ETH' then amount end) - sum(case when function_symbol in ('remove_liquidity ETH','remove_liquidity_one_coin ETH') then amount end) eth_net,
sum(case when function_symbol = 'add_liquidity stETH' then amount end) - sum(case when function_symbol in ('remove_liquidity stETH','remove_liquidity_one_coin stETH') then amount end) steth_net
from
functions
Run a query to Download Data