Yousefi_1994Cream Liquid Staking TVL over time
    Updated 2022-09-05
    with liquid_staking_by_cream as (
    select
    block_timestamp::date as days,
    sum(amount) as eth_amount,
    sum(eth_amount) over (order by days asc rows between unbounded preceding and current row) cumulative_eth_amount,
    count(distinct origin_from_address) as number_of_depositors,
    sum(number_of_depositors) over (order by days asc rows between unbounded preceding and current row) cumulative_number_of_depositors
    from ethereum.core.ez_eth_transfers
    where eth_to_address = '0xcbc1065255cbc3ab41a6868c22d1f1c573ab89fd'
    group by days
    order by days
    ),
    eth_price_usd as (
    select
    hour::date as days,
    avg(price) as price_usd
    from ethereum.core.fact_hourly_token_prices
    where symbol is null
    and token_address is null
    group by days
    ),
    liquid_staking_by_cream_with_usd as (
    select
    a.*,
    b.price_usd
    from liquid_staking_by_cream a
    join eth_price_usd b using(days)
    )

    select
    *,
    cumulative_eth_amount * price_usd as amount_usd,
    sum(amount_usd) over (order by days asc rows between unbounded preceding and current row) cumulative_amount_usd
    from liquid_staking_by_cream_with_usd
    order by days
    Run a query to Download Data