lidoLido Staked to/ Withdrawn from BC
    Updated 4 hours ago
    /*
    For better visualization, a 3-month period consists of the current month and the three months immediately preceding it
    Calculation logic:
    - create a date sequence to avoid the gaps in the data
    - declare Lido addresses
    - retrieve daily ETH deposits + cumulative amounts
    - retrieve Lido daily deposits + cumulative amounts
    - retrieve Lido daily withdrawals + cumulative withdrawal amount
    */

    -- date sequence for the past 3 months + current period
    WITH date_params AS (
    SELECT
    DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '3 month' AS start_date,
    CURRENT_DATE AS end_date
    )

    , day_seq AS (
    SELECT
    DATEADD('day', SEQ4(), start_date) AS day
    FROM date_params, TABLE(GENERATOR(ROWCOUNT => 1000)) -- Large enough to cover 3 months + some
    )

    , dates as (
    SELECT
    day
    FROM day_seq
    WHERE day BETWEEN (SELECT start_date FROM date_params) AND (SELECT end_date FROM date_params)
    )

    -----------Deposits-----------

    -- calculates daily deposits for the past 3 months
    , all_deposits AS (
    SELECT
    Last run: about 4 hours agoAuto-refreshes every 24 hours
    DAY
    staked daily
    withdrawn daily
    daily net staked
    Lido share
    cumulative staked
    cumulative withdrawn
    cumulative net staked
    TOTAL_CUMULATIVE_DEPOSITS
    1
    2025-06-02 00:00:00.0000002.267434508104096-526975.989686604-422879.9896866044590915.39901015
    2
    2025-06-01 00:00:00.0000002.272746923104096-526975.989686604-422879.9896866044580184.39901015
    3
    2025-05-31 00:00:00.0000-8576-85762.301800038104096-526975.989686604-422879.9896866044522373.71901015
    4
    2025-05-30 00:00:00.0000002.33454534104096-518399.989686604-414303.9896866044458941.02937085
    5
    2025-05-29 00:00:00.0000-9888-98882.368108376104096-518399.989686604-414303.9896866044395744.76604186
    6
    2025-05-28 00:00:00.0000-12000-120002.399915618104096-508511.989686604-404415.9896866044337485.83594186
    7
    2025-05-27 00:00:00.0000002.456192521104096-496511.989686604-392415.9896866044238104.26597208
    8
    2025-05-26 00:00:00.0000-32-322.503455496104096-496511.989686604-392415.9896866044158092.69115342
    9
    2025-05-25 00:00:00.0000-736-7362.523398142104096-496479.989686604-392383.9896866044125230.90515342
    10
    2025-05-24 00:00:00.0000-7840-78402.529550288104096-495743.989686604-391647.9896866044115197.88759069
    11
    2025-05-23 00:00:00.0000002.544945986104096-487903.989686604-383807.9896866044090302.92056138
    12
    2025-05-22 00:00:00.0000-21056-210562.581557351104096-487903.989686604-383807.9896866044032294.69105614
    13
    2025-05-21 00:00:00.0000002.639543981104096-466847.989686604-362751.9896866043943711.51820234
    14
    2025-05-20 00:00:00.0000-31584-315842.68547717104096-466847.989686604-362751.9896866043876257.11990234
    15
    2025-05-19 00:00:00.0000-63424-634242.721117004104096-435263.989686604-331167.9896866043825487.83657514
    16
    2025-05-18 00:00:00.0000002.751100395104096-371839.989686604-267743.9896866043783795.02977677
    17
    2025-05-17 00:00:00.0000-320-3202.783622921104096-371839.989686604-267743.9896866043739586.96762127
    18
    2025-05-16 00:00:00.0000-383.992126911-383.9921269112.797142003104096-371519.989686604-267423.9896866043721512.88299592
    19
    2025-05-15 00:00:00.0000-1440-14402.828019022104096-371135.997559693-267039.9975596933680880.47506201
    20
    2025-05-14 00:00:00.0000-1728-17282.849279934104096-369695.997559693-265599.9975596933653414.28056201
    94
    9KB
    20s