cloudr3nHyperbeat Vault Daily Deposits
    Updated 2025-04-18
    with
    vault_txs as (
    select * from community.ethereum.hyperbeat_vault_actions
    ),

    daily_prices as (
    select
    date(hour) as date_time,
    avg(price) as avg_price,
    token_address
    from
    ethereum.price.ez_prices_hourly
    group by
    date_time,
    token_address
    ),

    date_ls as (
    select
    date_day,
    from
    ethereum.core.dim_dates
    where
    date_day<= current_date()
    and date_day >= '2025-02-19'
    ),

    vault_agg as (
    select
    date(block_timestamp) as day,
    sum(case when event_name = 'Enter' then amount when event_name = 'Exit' then amount*-1 end) daily_changes,
    sum(daily_changes) over (partition by vault_address, asset order by day asc) net_deposit,
    vault_address, -- vault
    vault_name,
    asset,
    symbol
    QueryRunArchived: QueryRun has been archived