sakineh5021-nIQRzBConcentration of Capital 10
    Updated 2022-04-11
    with pool as (
    SELECT POOL_ADDRESS , POOL_NAME
    FROM ethereum.dex_liquidity_pools
    where platform ='sushiswap'
    ) ,
    per as (
    SELECT POOL_NAME , balance_date , max(balance) as max_LP ,sum(balance) as total , max_LP/total*100 as percent
    from ethereum.erc20_balances
    left outer join pool P on POOL_ADDRESS = contract_address
    where POOL_NAME is not NULL
    and balance is not null
    and balance_date >'2022-01-01'
    group by 1 , 2
    ) ,
    L1 as (
    SELECT balance_date , count(POOL_NAME) as less50
    from per
    where percent <=50
    group by 1
    )
    ,
    L2 as (
    SELECT balance_date , count(POOL_NAME) as less35
    from per
    where percent <=35
    group by 1
    ) ,
    L3 as (
    SELECT balance_date , count(POOL_NAME) as less65
    from per
    where percent <=65
    group by 1
    )
    Run a query to Download Data