lidostETH to ETH rate
    Updated 2 hours ago
    /*
    Base assumption:
    stETH:ETH rate is determined primarily using the main stETH:ETH Curve pool because most of the protocols built their Price Oracles based on this pool.

    */
    -- ETH->stETH swaps
    with exchanges as (
    SELECT
    BLOCK_TIMESTAMP as time
    , tx_hash
    , case when token_in = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' then amount_in
    when token_out = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' then amount_out
    end as steth_amount
    , case when token_in = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' then amount_in
    when token_out = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' then amount_out
    end as eth_amount
    FROM Ethereum.defi.ez_dex_swaps
    where CONTRACT_ADDRESS = '0xdc24316b9ae028f1497c275eb9192a3ea0f67022'
    AND steth_amount is NOT NULL
    and eth_amount is NOT NULL
    )


    -- calculates the swap rate for the past 30 days
    SELECT
    date_trunc('hour', time) as time
    , SUM(steth_amount) as steth_amount
    , SUM(eth_amount) as eth_amount
    , SUM(eth_amount)/ SUM(steth_amount) as rate
    FROM exchanges
    WHERE steth_amount > 2 -- filter for txns with minor quantities with screwed rate
    and time >= current_date - interval '30 days'
    GROUP by 1
    ORDER by 1 DESC


    Last run: about 2 hours agoAuto-refreshes every 24 hours
    TIME
    STETH_AMOUNT
    ETH_AMOUNT
    RATE
    1
    2025-05-29 06:00:00.00042.99451871642.9829582190.9997311169
    2
    2025-05-29 05:00:00.00048.72470607948.7033491090.9995616809
    3
    2025-05-29 04:00:00.00015.57932841315.5725536740.9995651456
    4
    2025-05-29 03:00:00.00047.92525609547.908070160.9996414013
    5
    2025-05-29 02:00:00.00042.10087089142.0892904620.9997249361
    6
    2025-05-29 01:00:00.00020.17516350120.1664177560.9995665093
    7
    2025-05-29 00:00:00.00086.3274155486.2957770390.9996335058
    8
    2025-05-28 23:00:00.00030.09774260630.0848703190.9995723172
    9
    2025-05-28 20:00:00.00022.82306179322.8133740370.9995755278
    10
    2025-05-28 19:00:00.00076.997040610.9995772301
    11
    2025-05-28 18:00:00.00015.26047312715.2540419730.9995785744
    12
    2025-05-28 17:00:00.0007.867.8566968010.9995797456
    13
    2025-05-28 16:00:00.00013.80343520313.7976496510.9995808614
    14
    2025-05-28 14:00:00.00019.72687800719.7186480090.9995828028
    15
    2025-05-28 13:00:00.0005.6655132555.663156170.9995839591
    16
    2025-05-28 12:00:00.00012.2149815312.2099108170.9995848776
    17
    2025-05-28 11:00:00.0006.0190820756.0165915480.9995862282
    18
    2025-05-28 09:00:00.00055.98428167855.9640089650.9996378856
    19
    2025-05-28 08:00:00.000384.532104776384.3899244550.9996302511
    20
    2025-05-28 04:00:00.000142.627200213142.60.9998092915
    ...
    530
    34KB
    3s