sakineh5021-nIQRzBConcentration of Capital 6
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
›
⌄
with pool as (
SELECT POOL_ADDRESS , POOL_NAME
FROM ethereum.dex_liquidity_pools
where platform ='sushiswap'
)
,
mas as (
SELECT POOL_NAME , user_address , balance
from ethereum.erc20_balances
left outer join pool P on POOL_ADDRESS = contract_address
where balance_date = '2022-04-01'
and POOL_NAME is not NULL
order by balance DESC
limit 1
)
,
oth as (
SELECT POOL_NAME , sum(balance) as other
from ethereum.erc20_balances B , mas M
left outer join pool P on POOL_ADDRESS = contract_address
where balance_date = '2022-04-01'
and B.user_address <> M.user_address
and POOL_NAME is not NULL
group by 1
)
SELECT O.POOL_NAME , other , M.balance
from oth O
left outer join mas M on M.POOL_NAME = O.POOL_NAME
where MasterChef is not NULL
order by 3 desc
limit 20
Run a query to Download Data