SalehLiquidity Pools - Wallet Composition-types
    Updated 2022-10-25
    with token_price as (
    select
    recorded_at::date as day
    ,symbol
    ,address as symbol_address
    ,avg(price) as price
    from osmosis.core.dim_prices join osmosis.core.dim_labels on project_name = symbol
    group by day,symbol,address)
    ,lst_all as (
    select
    address
    ,sum(balance*price/pow(10,decimal)) as amount_usd
    from osmosis.core.fact_daily_balances
    join token_price on currency = symbol_address and date = day
    where date = CURRENT_DATE-1
    group by 1
    )
    select
    case
    when amount_usd>0 and amount_usd<=50 then 'Shrimp'
    when amount_usd>50 and amount_usd<=700 then 'Crab'
    when amount_usd>700 and amount_usd<=7000 then 'Fish'
    when amount_usd>7000 and amount_usd<=70000 then 'Shark'
    when amount_usd>70000 then 'Whale'
    end as type
    ,count(address) as wallets
    from lst_all
    group by 1
    order by 1
    Run a query to Download Data