SocioAnalyticacurrent tvl
    Updated 2024-04-23
    with deposit as (
    select
    symbol,
    sum(amount) as volume_deposit
    from blast.blitz.ez_clearing_house_events
    where MODIFICATION_TYPE = 'deposit'
    group by 1
    )
    ,
    withdraw as (
    select
    symbol,
    sum(-1 * amount) as volume_withdraw
    from blast.blitz.ez_clearing_house_events
    where MODIFICATION_TYPE = 'withdraw'
    group by 1
    )
    ,
    prices as (
    select
    *
    from (
    select
    hour,
    symbol,
    price
    from blast.price.ez_hourly_token_prices
    union all
    select
    hour,
    'ETH' as symbol,
    price
    from blast.price.ez_hourly_token_prices
    where symbol = 'WETH')
    qualify row_number () over (partition by symbol order by hour desc) = 1
    )
    QueryRunArchived: QueryRun has been archived