Yousefi_1994Number of Qualified Pools on Uniswap and Sushiswap
    Updated 2022-09-30
    with sushiswap_pools as (
    select
    pool_address,
    token0,
    token1
    from ethereum.core.dim_dex_liquidity_pools
    where platform = 'sushiswap'
    ),
    uniswap_pools as (
    select
    pool_address,
    token0,
    token1
    from ethereum.core.dim_dex_liquidity_pools
    where platform = 'uniswap-v3' or platform = 'uniswap-v2'
    ),
    sushiswap_tvl as (
    select
    pool_address as pool,
    sum(amount_usd) as pool_tvl
    from ethereum.erc20_balances, sushiswap_pools
    where user_address = pool_address
    and contract_address in (token0, token1)
    and balance_date = current_date - 1
    and amount_usd < 500000000
    group by pool
    having pool_tvl > 100000
    ),
    uniswap_tvl as (
    select
    pool_address as pool,
    sum(amount_usd) as pool_tvl
    from ethereum.erc20_balances, uniswap_pools
    where user_address = pool_address
    and contract_address in (token0, token1)
    and balance_date = current_date - 1
    Run a query to Download Data