sakineh5021-nIQRzBUntitled Query
Updated 2022-04-06
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 add_liq as (
select TO_ADDRESS_NAME as wallet , sum(amount_usd) as usd , sum(amount) as number
from polygon.udm_events
where TO_LABEL = 'sushiswap'
and TO_LABEL_SUBTYPE = 'pool'
and symbol <>'TITAN'
group by 1
) ,
rem_liq as (
select from_ADDRESS_NAME as wallet , sum(amount_usd) as usd , sum(amount) as number
from polygon.udm_events
where from_LABEL = 'sushiswap'
and from_LABEL_SUBTYPE = 'pool'
and symbol <>'TITAN'
group by 1
)
SELECT A.wallet as liquidity_pools , ( A.usd-R.usd)/2 as TVL
from add_liq A , rem_liq R
where A.wallet=R.wallet
and TVL is not NULL
order by TVL DESC
Run a query to Download Data