0xHaM-dStakers Address (stETH <=> ETH)
    Updated 2022-11-28
    -- 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