adriaparcerisasSushiswap qualified pools 3
    Updated 2022-07-06
    WITH
    pools as (
    select
    pool_address
    from ethereum.dex_liquidity_pools
    ),
    tvls as (
    select
    --trunc(balance_date,'day') as date,
    address_name as pool,
    label as platform,
    sum(amount_usd) as tvl
    from ethereum.erc20_balances
    where balance_date>=CURRENT_DATE-1
    and (label = 'sushiswap' or label like '%uniswap%')
    and user_address in (
    select * from pools
    ) and amount_usd < 1e9 and amount_usd is not null
    group by 1,2
    order by 3 desc
    ),
    qualified_pools as (
    SELECT
    distinct pool
    --platform
    from tvls
    where tvl>=100000
    group by 1
    ),
    last_block as (
    SELECT
    max(block_number) as last_block
    from ethereum.core.ez_dex_swaps
    ),
    volumes_in as (
    SELECT
    Run a query to Download Data