sakineh5021-nIQRzBUntitled Query
    Updated 2022-04-06
    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