Crazy_KidConcentration of Capital 4
    Updated 2022-04-04
    WITH pool as (SELECT to_address_name as liq_pool1, sum(amount_usd) as liq_added
    FROM ethereum.udm_events
    WHERE to_label = 'sushiswap' AND to_label_subtype = 'pool'
    AND origin_function_name IN ('addLiquidity', 'addLiquidityETH')
    AND amount_usd IS NOT NULL
    GROUP BY liq_pool1),

    users AS (SELECT from_address, to_address_name as liq_pool2, sum(amount_usd) as amount
    FROM ethereum.udm_events
    WHERE to_label = 'sushiswap' AND to_label_subtype = 'pool'
    AND origin_function_name IN ('addLiquidity', 'addLiquidityETH')
    AND amount_usd IS NOT NULL
    GROUP BY from_address, liq_pool2),

    final as (SELECT from_address, liq_pool1 as liq_pool, amount, liq_added, (amount > liq_added/2) as "Single LP holds more than 50% of Funds"
    FROM users JOIN pool on liq_pool2 = liq_pool1
    WHERE amount > liq_added/2
    ORDER BY liq_added DESC
    LIMIT 1000)

    SELECT from_address as user, COUNT(liq_pool) as no_of_pools_with_majority_share
    FROM final
    GROUP BY user
    ORDER BY no_of_pools_with_majority_share DESC
    LIMIT 10
    Run a query to Download Data