dariustay_0512Daily and cumulative amount of ETH staked on Lido in the past 3 months
    Updated 2023-04-13
    WITH staked_eth AS(
    SELECT
    date(block_timestamp) AS date,
    sum(event_inputs:amount/pow(10,18)) AS total_daily_eth, -- total ETH staked daily
    sum(total_daily_eth) OVER (ORDER BY date) AS cumulative_eth -- cumulative ETH staked
    FROM ethereum.core.fact_event_logs
    WHERE origin_to_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' -- ETH sent to Lido contract address
    AND tx_status = 'SUCCESS'
    AND date >= dateadd(day, -90, GETDATE()) -- past 3 months
    GROUP BY 1
    ORDER BY 1
    )

    -- Labelling the variables --
    SELECT
    date as "Date",
    total_daily_eth as "Daily stETH",
    cumulative_eth as "Cumulative stETH"
    FROM staked_eth;
    Run a query to Download Data