Updated 2022-08-24
    with tb1 as (SELECT *
    from ethereum.core.dim_dex_liquidity_pools
    where PLATFORM='sushiswap')

    SELECT
    case
    when label is not null then 'owned by the Protocol'
    when label is null then 'Retail LP'
    end as gp,
    sum(AMOUNT_USD) as TVL
    from ethereum.core.ez_token_transfers x left outer join ethereum.core.dim_labels y on x.ORIGIN_FROM_ADDRESS=y.ADDRESS
    where TO_ADDRESS in (select POOL_ADDRESS from tb1)
    and ORIGIN_TO_ADDRESS='0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f'
    and origin_function_signature in ('0xe8e33700', '0xded9382a', '0xf305d719')
    group by 1 having gp is not null
    Run a query to Download Data