lidostETH to ETH rate
    Updated 11 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 11 hours agoAuto-refreshes every 24 hours
    TIME
    STETH_AMOUNT
    ETH_AMOUNT
    RATE
    1
    2025-06-18 02:00:00.0003.9520428853.9520.9999891487
    2
    2025-06-18 00:00:00.00017.91061889217.9068545740.9997898276
    3
    2025-06-17 20:00:00.0008.8234843458.8216416930.9997911651
    4
    2025-06-17 16:00:00.00086.78846010686.7874248140.9999880711
    5
    2025-06-17 15:00:00.0004.83530994.8342670140.9997843187
    6
    2025-06-17 14:00:00.0007.97.898302940.9997851823
    7
    2025-06-17 12:00:00.0003.7530010553.7521974920.999785888
    8
    2025-06-17 11:00:00.00018.12076383318.1169034650.9997869644
    9
    2025-06-17 10:00:00.00041.23058177941.230.9999858896
    10
    2025-06-17 09:00:00.0008.5219286518.5200910670.9997843699
    11
    2025-06-17 06:00:00.0004.2866169854.2856959480.9997851366
    12
    2025-06-17 05:00:00.000109.9978572420.9997857242
    13
    2025-06-17 04:00:00.00090.53923010590.5202720890.9997906099
    14
    2025-06-17 01:00:00.000133.7888245133.7622358170.9998012638
    15
    2025-06-17 00:00:00.00011.20098078811.1988335730.9998083012
    16
    2025-06-16 23:00:00.000169.615848207169.6156032440.9999985558
    17
    2025-06-16 17:00:00.00020.09222342820.0889466390.9998369126
    18
    2025-06-16 16:00:00.00046.57805412846.5704440230.9998366161
    19
    2025-06-16 12:00:00.0006.0008596085.9996477430.9997980513
    20
    2025-06-16 11:00:00.00045.97047190245.9702998740.9999962578
    ...
    421
    27KB
    3s