strawbettystablecoin tvl
    Updated 2022-06-03
    with pools as (SELECT
    distinct
    pool_name,
    case when pool_name like '%USD%' then 'stable'
    when pool_name like '%PAX' then 'stable'
    when pool_name like '%DAI%' then 'stable' else 'non' end as stable,
    last_value(token0_balance_usd) OVER (PARTITION BY pool_name ORDER BY block_timestamp)+
    last_value(token1_balance_usd) OVER (PARTITION BY pool_name ORDER BY block_timestamp) as tvl
    FROM uniswapv3.pool_stats
    where block_timestamp between CURRENT_Date-7 and current_date
    and (pool_name like '%DAI%' OR pool_name like '%USD%' OR pool_name like '%PAX%')
    and token0_balance_usd + token1_balance_usd < 500000000
    )

    select
    stable||'-'||
    left(pool_name, 9) as pl_gp,
    count(distinct pool_name) as cnt,
    sum(tvl) as tvl
    from pools
    where stable = 'stable'
    group by 1 having count(distinct pool_name) >1
    order by 3 desc
    limit 5
    Run a query to Download Data