0xHaM-dStakers Address (stETH <=> ETH)
Updated 2022-11-28
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
31
32
33
34
35
36
›
⌄
-- SQL is credited to https://hexagonal-telescope-6b0.notion.site/Gain-or-Lose-Analysis-0b4dbab55a5f43c481fae5fffd3d2f24
-- Swaps by Staker
WITH ethtosteth
AS (SELECT sender AS staker,
Count(DISTINCT tx_hash) AS eth_swaps,
Sum(amount_in) AS amount_swapped_in,
Sum(amount_out) AS amount_swapped_out,
Sum(amount_in_usd) AS amount_swapped_in_usd,
Sum(amount_out_usd) AS amount_swapped_out_usd,
'ETH to stETH' AS swap_catg
FROM ethereum.core.ez_dex_swaps
WHERE event_name = 'Swap'
AND symbol_out = 'stETH'
AND symbol_in LIKE '%ETH'
AND token_in = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
AND token_out = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
AND amount_in > 0
AND amount_in IS NOT NULL
AND amount_out > 0
AND amount_out IS NOT NULL
AND amount_in_usd > 0
AND amount_in_usd IS NOT NULL
AND amount_out_usd > 0
AND amount_out_usd IS NOT NULL
AND block_timestamp::date >= '{{Since_date}}'
GROUP BY sender),
stethtoeth
AS (SELECT sender AS staker,
Count(DISTINCT tx_hash) AS steth_swaps,
Sum(amount_in) AS amount_swapped_in,
Sum(amount_out) AS amount_swapped_out,
Sum(amount_in_usd) AS amount_swapped_in_usd,
Sum(amount_out_usd) AS amount_swapped_out_usd,
'stETH to ETH' AS swap_catg
FROM ethereum.core.ez_dex_swaps
WHERE event_name = 'Swap'
Run a query to Download Data