cypherETH staked with lido over last 3 months
    Updated 2022-06-13
    with data as (select
    date_trunc('day', block_timestamp) as date,
    sum(event_inputs:value/1e18) as amount_staked
    from ethereum.core.fact_event_logs
    where date >= current_date() - 90
    and event_inputs:from = lower('0x0000000000000000000000000000000000000000')
    and contract_address = lower('0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
    group by DATE)

    select *,
    avg(amount_staked) OVER(ORDER BY date
    ROWS BETWEEN 6 PRECEDING AND CURRENT ROW )
    as "7day_moving_average",
    avg(amount_staked) OVER(ORDER BY date
    ROWS BETWEEN 29 PRECEDING AND CURRENT ROW )
    as "30day_moving_average"
    from data

    -- select *, event_inputs:value/1e18 as amount from
    -- where event_inputs:from = lower('0x0000000000000000000000000000000000000000')
    -- and contract_address = lower('0xae7ab96520de3a18e5e111b5eaab095312d7fe84')
    -- limit 100
    Run a query to Download Data