MLDZMNsushi1
Updated 2022-07-07Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with tb1 as (select
POOL_ADDRESS
from ethereum.core.dim_dex_liquidity_pools where PLATFORM='sushiswap'
),
tb2 as (select
ADDRESS_NAME,
sum(AMOUNT_USD) as TVL
from flipside_prod_db.ethereum.erc20_balances x left outer join ethereum.core.dim_dex_liquidity_pools y on x.USER_ADDRESS=y.POOL_ADDRESS
where USER_ADDRESS in (select POOL_ADDRESS from tb1)
and BALANCE_DATE=CURRENT_DATE-2
and amount_usd is not null
and address_name is not null
group by 1 having TVL>=100000
order by 2 desc),
tb3 as (select
ADDRESS_NAME,
sum(AMOUNT_USD) as TVL
from flipside_prod_db.ethereum.erc20_balances x left outer join ethereum.core.dim_dex_liquidity_pools y on x.USER_ADDRESS=y.POOL_ADDRESS
where USER_ADDRESS in (select POOL_ADDRESS from tb1)
and BALANCE_DATE=CURRENT_DATE-2
and amount_usd is not null
and address_name is not null
group by 1 having TVL<100000
order by 2 desc)
select
'Qualified Pools' as pool_type,
count(distinct ADDRESS_NAME) as no_pool
from tb2
union all
select
'Not-Qualified Pools' as pool_type,
Run a query to Download Data