SalehLiquidity Pools - Wallet Composition-types
Updated 2022-10-25
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
›
⌄
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