MLDZMNlido5
    Updated 2023-05-21
    -- forked from lido4 @ https://flipsidecrypto.xyz/edit/queries/8c8e1d44-acba-46b1-9f1d-b43a8cf16f5b

    -- forked from lido1 @ https://flipsidecrypto.xyz/edit/queries/dbc77b38-a863-4e1d-aaa4-0d3490aa2ee3
    with tb1 as (select
    HOUR,
    avg(price) as ETH_price,
    lag(ETH_price) ignore nulls over(ORDER BY hour ASC) as lag_price,
    ((ETH_price-lag_price)/ETH_price)*100 as deviation_price_ETH
    from ethereum.core.fact_hourly_token_prices
    where hour>= '2023-05-15'
    and symbol in ('WETH')
    group by 1),

    tb2 as (select
    HOUR,
    avg(price) as BTC_price,
    lag(BTC_price) ignore nulls over(ORDER BY hour ASC) as lag_price,
    ((BTC_price-lag_price)/BTC_price)*100 as deviation_price_BTC
    from ethereum.core.fact_hourly_token_prices
    where hour>= '2023-05-15'
    and symbol in ('WBTC')
    group by 1),


    pp as (select
    hour,
    avg(price) as token_price,
    lag(token_price) ignore nulls over(ORDER BY hour ASC) as lag_price,
    ((token_price-lag_price)/token_price)*100 as deviation_price_stETH
    from ethereum.core.fact_hourly_token_prices
    where token_address=lower('0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84')
    and hour>= '2023-05-15'
    group by 1
    ),

    t1 as (SELECT
    Run a query to Download Data