CryptoIcicleLido-11.HODL or Sell? - Sellers
    Updated 2022-06-13
    -- Payout 75 USDC
    -- Grand Prize 225 USDC
    -- Level Intermediate
    -- Q11. Identify accounts that have staked ETH with Lido when the price of ETH was much higher or much lower than it is now.
    -- Have they held or sold their stETH?
    with steth_price as (
    select
    date_trunc('day', hour) as date,
    avg(price) as price
    from ethereum.token_prices_hourly
    where token_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' -- stETH
    and hour >= '2021-09-01'
    group by date
    ),
    eth_price as (
    select
    date_trunc('day', hour) as date,
    avg(price) as price
    from ethereum.token_prices_hourly
    where symbol = 'WETH'
    and hour >= '2021-09-01'
    group by date
    ),
    ratio as (
    select
    s.date,
    s.price as steth,
    e.price as eth,
    eth/steth as eth_steth_ratio,
    steth/eth as steth_eth_ratio
    from steth_price s
    join eth_price e on s.date = e.date
    ),
    high_diff as (
    select