FatemeTheLady WB 10
Updated 2022-11-04
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
30
31
32
33
34
35
36
›
⌄
--credit to Jinx
with a as(
select address
,sum(balance/ pow(10,6)) as old_balance
from osmosis.core.fact_daily_balances
where CURRENCY = 'uosmo'
and date::date = '2022-01-01'
group by 1
order by 2 desc
limit 100
)
,
aa as (
select row_number() over(order by old_balance desc) as old_rank, '1' AS COUNT_
, * from a
)
,
B as(
select address
,sum(balance/ pow(10,6)) as NEW_balance
from osmosis.core.fact_daily_balances
where CURRENCY = 'uosmo'
and date::date = CURRENT_DATE-1
AND address IN (SELECT address FROM AA)
group by 1
order by 2 desc
limit 100
)
,
BB as (
select '1' AS COUNT_
, * from B
)
SELECT
case when address IN (SELECT address FROM bb) then 'Still one of top 100 holders' when address not IN (SELECT address FROM bb) then 'not one of new top 100 holders' end as status,
Run a query to Download Data