MoeETH TO STETH
Updated 2022-06-15Copy 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
23
24
25
26
27
28
29
30
›
⌄
with st as ( SELECT
distinct EVENT_INPUTS:to as stakers
FROM ethereum.core.fact_event_logs
WHERE TX_STATUS = 'SUCCESS'
and EVENT_INPUTS:from = '0x0000000000000000000000000000000000000000'
AND
CONTRACT_ADDRESS = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' )
,t2 as ( select
SENDER,
AMOUNT_OUT,
AMOUNT_IN,
AMOUNT_IN-AMOUNT_OUT as profit_eth,
case
when profit_eth > 0 then 'gain'
when profit_eth < 0 then 'lose'
end as result
from ethereum.core.ez_dex_swaps
where SYMBOL_IN ilike 'steth' and SYMBOL_OUT ilike 'weth'
and sender in (select stakers from st ))
select
result,
count(*) as countt,
sum(profit_eth) as total_profit_losS
from t2 group by 1
Run a query to Download Data