cypherstETH - HODL or Sell - n stakers above and below current price
    Updated 2022-06-14
    -- identify accounts that have staked their ETH by swapping to stETH.
    -- Find the price of eth when they staked by looking at the time of the swap and getting corresponding eth price
    -- Identify accounts that have sold a part or all of their steth by using the erc20_balance table.

    with data as (select
    date(date_trunc('day', block_timestamp)) as date,
    tx_hash,
    origin_from_address as address,
    event_inputs:value/1e18 as amount_staked
    from ethereum.core.fact_event_logs
    where
    event_inputs:from = lower('0x0000000000000000000000000000000000000000')
    and contract_address = lower('0xae7ab96520de3a18e5e111b5eaab095312d7fe84')),

    eth_price as (select
    date_trunc('day', hour) as date,
    avg(price) as eth_price
    from ethereum.core.fact_hourly_token_prices
    where token_address is null
    group by date),

    total_daily_staked as (select date, address, sum(amount_staked) as total_staked
    from data
    group by date, address),

    joined as (
    select * from total_daily_staked
    left join eth_price using (date)
    ),
    unique_addreseses as (
    select count(distinct(address)) as n_unique_addresses
    from joined
    ),
    below_current as (
    select count(distinct(address)) as n_address
    from joined
    Run a query to Download Data