boomer77top 10%
Updated 2022-01-26
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
with raw as (select date, address, sum(balance) as total, currency, ROW_NUMBER() OVER(partition by date ORDER BY total desc) AS Rank
from terra.daily_balances
where currency in ('LUNA')
and address not in ('terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh', 'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6',
'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts', 'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f', 'terra1n6txvxn6cf02nn5slra57vs22mdsdy27kv2kuc',
'terra1swggaf7nw9p680q4lngs340ar24g3lecr7x9ed', 'terra13u66u4knssnws7n7w0n38mzyyqak5ygp807gyl')
and date >= CURRENT_DATE - 7 and balance > 0
group by 1,2,4
order by total desc),
top100 as (select date, sum(total) as balance, count(distinct address) as Holder
from raw
where rank < 33406
group by 1),
total as (select date, sum(total) as balance, count(distinct address) as Holder
from raw
group by 1)
select a.date, a.balance as top100, b.balance as total, round(((top100/total)*100),2) as "Top 10%", (100 - "Top 10%") as totalp
from top100 a
join total b on a.date = b.date
Run a query to Download Data