Yousefi_1994Opyn Squeeth Total Value Locked per Pool
    Updated 2022-07-02
    with eth_osqth_Pool as (
    select
    pool_name,
    pool_address,
    token0,
    token1
    from ethereum.core.dim_dex_liquidity_pools
    where pool_name ilike '%oSQTH%'
    )
    select
    balance_date as days,
    pool_name,
    sum((non_adjusted_balance/1e18 * price)) as tvl
    from ethereum.erc20_balances, eth_osqth_Pool
    where user_address = pool_address
    and (contract_address = token0 or contract_address = token1)
    and balance_date >= '2022-01-01'
    and price is not null
    group by days, pool_name
    order by days
    Run a query to Download Data