Sbhn_NPhandsome-black
    Updated 2025-01-14
    with deposit as (
    SELECT date_trunc('day',block_timestamp) as date,
    count(DISTINCT origin_from_address) as depositors,
    sum(ethereum.public.udf_hex_to_int(regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}')[0]) / pow(10,18)) AS deposited
    from ink.core.fact_event_logs
    where topic_0 = '0x90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15'
    and origin_to_address = '0xcab283e4bb527aa9b157bae7180fef19e2aaa71a'
    group by 1),

    withdraw as (select date_trunc('day',block_timestamp) as date,
    count(DISTINCT origin_from_address) as withdrawers,
    sum(ethereum.public.udf_hex_to_int(regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}')[0]) / pow(10,18)) AS withdrawn
    from ink.core.fact_event_logs
    where topic_0 = '0x6c3a45613039e0a1117bd6ce110ab3c920271709c010983d921a2cd268e2ea47'
    and origin_to_address = '0xcab283e4bb527aa9b157bae7180fef19e2aaa71a'
    GROUP by 1)

    select date,
    depositors,
    withdrawers,
    deposited as "Deposited ETH",
    -withdrawn as "Withdrawn ETH",
    deposited-withdrawn as "NET Staked ETH",
    sum(deposited) over (order by date) as cumu_d,
    sum(withdrawn) over (order by date) as cumu_w,
    cumu_d-cumu_w as tvl,
    from deposit
    join withdraw using(date)
    order by 1 desc

    Last run: 3 months ago
    DATE
    DEPOSITORS
    WITHDRAWERS
    Deposited ETH
    Withdrawn ETH
    NET Staked ETH
    CUMU_D
    CUMU_W
    TVL
    1
    2025-01-14 00:00:00.000464160.5462013405-0.15614916810.390052172452.78955024212.91513496539.874415278
    2
    2025-01-13 00:00:00.00047980.8866913773-0.27958276830.60710860952.24334890212.75898579639.484363106
    3
    2025-01-12 00:00:00.0001867195.157341625-0.80678898174.35055264351.35665752512.47940302838.877254497
    4
    2025-01-11 00:00:00.0002792163.866439222-0.16220972853.70422949346.199315911.67261404634.526701853
    5
    2025-01-10 00:00:00.0001960143.06850184-0.19140580342.87709603742.33287667811.51040431830.82247236
    6
    2025-01-09 00:00:00.000206852.597289334-1.2797047731.31758456139.26437483811.31899851427.945376323
    7
    2025-01-08 00:00:00.0004313126.039682104-0.11064206485.92904003936.66708550410.03929374126.627791763
    8
    2025-01-07 00:00:00.0007254188.140088774-0.6825777367.45751103830.6274033999.92865167620.698751723
    9
    2025-01-06 00:00:00.000197752.947681476-2.0031757610.944505715322.4873146259.2460739413.241240685
    10
    2025-01-05 00:00:00.0004210.583628887-0.030013138440.553615748619.5396331497.24289817912.296734969
    11
    2025-01-04 00:00:00.0003012.336631953-0.1200380392.21659391418.9560042627.21288504111.743119221
    12
    2025-01-03 00:00:00.0003121.267761141-1.0302205120.237540629816.6193723087.0928470029.526525307
    13
    2025-01-02 00:00:00.0002920.3524914607-0.018405129150.334086331515.3516111676.062626499.288984677
    14
    2025-01-01 00:00:00.0004030.7267673801-0.9201507667-0.193383386614.9991197066.0442213618.954898345
    15
    2024-12-31 00:00:00.0001920.10026-1.470153186-1.36989318614.2723523265.1240705949.148281732
    16
    2024-12-29 00:00:00.0003030.2680114929-1.00546169-0.737450196714.1720923263.65391740910.518174917
    17
    2024-12-28 00:00:00.0002841.596677965-0.34203262551.2546453413.9040808332.64845571911.255625114
    18
    2024-12-26 00:00:00.0004242.229549812-1.0910034771.13854633612.3074028682.30642309410.000979774
    19
    2024-12-25 00:00:00.0004140.8253660729-0.33500841730.490357655610.0778530561.2154196178.862433439
    20
    2024-12-24 00:00:00.0004311.410823642-0.080008473771.3308151699.2524869830.88041119978.372075783
    24
    3KB
    9s