hessTop Symbol Out of SushiSwap Qualified Pools
Updated 2022-07-07
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
›
⌄
with pool_address as ( select platform, pool_address , pool_name
from ethereum.core.dim_dex_liquidity_pools
where platform in ( 'sushiswap', 'uniswap-v2', 'uniswap-v3'))
,
final as ( select platform , pool_address , pool_name , sum(AMOUNT_USD) as tvl
from flipside_prod_db.ethereum.erc20_balances a join pool_address b on a.user_address = b.pool_address
where balance_date = '2022-07-05'
group by 1,2,3
)
,
final1 as ( select 'Sushiswap' as platform , pool_address , tvl
from final
where tvl >= 100000 and platform = 'sushiswap'
UNION
select 'Uniswap' as platform ,pool_address , tvl
from final
where tvl >= 100000 and platform in ( 'uniswap-v2', 'uniswap-v3')
)
select symbol_out , sum(amount_in_usd) as total_volume
from ethereum.core.ez_dex_swaps
where CONTRACT_ADDRESS in ( select pool_address from final1)
and BLOCK_NUMBER > 100000 and platform = 'sushiswap' and event_name = 'Swap'
group by 1
Run a query to Download Data