headitmanagerLargest pool with incoming assets
Updated 2022-06-22
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
›
⌄
with allpool as (select pool_name,pool_address from ethereum.core.dim_dex_liquidity_pools where token0=lower('0x2e9d63788249371f1DFC918a52f8d799F4a38C94')
)
, tbl_in as (
select sum(amount) as amount_in,to_address from ethereum.core.ez_token_transfers where contract_address=lower('0x2e9d63788249371f1DFC918a52f8d799F4a38C94')
and amount>0
group by to_address
)
, tbl_out as (
select sum(amount) as amount_out,from_address from ethereum.core.ez_token_transfers where contract_address=lower('0x2e9d63788249371f1DFC918a52f8d799F4a38C94')
and amount>0
group by from_address
)
,holders as (
select (amount_in-amount_out) as amount,to_address from tbl_in left join tbl_out
on to_address=from_address
where (amount_in-amount_out)>0
order by amount DESC)
, largest_pool as (select sum(amount_in_usd),sum(amount_out_usd),pool_name
from ethereum.core.ez_dex_swaps where pool_name like 'TOKE-%'
group by pool_name)
, holders_in_pool as (select sum(amount_in_usd),sum(amount_out_usd),pool_name from ethereum.core.ez_dex_swaps where pool_name like 'TOKE-%'
and sender in (select to_address from holders)
group by pool_name)
select * from largest_pool
Run a query to Download Data