binhachon$RUNE Distribution
Updated 2022-04-23
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
›
⌄
with transactions as (
select
from_address,
case when lp_action = 'add_liquidity' then rune_amount else - rune_amount end as amount
from thorchain.liquidity_actions
where rune_amount > 0
union all
select
from_address,
-rune_amount as amount
from thorchain.transfers
union all
select
to_address,
rune_amount as amount
from thorchain.transfers
),
balance_table as (
select
from_address,
sum(amount) as amount
from transactions
group by 1
)
select
floor(amount, -2) as rounded_amount,
sum(amount) as rune_holding,
100 * ratio_to_report(rune_holding) over () as percentage_holding,
count(*) as number_of_addresses,
100 * ratio_to_report(number_of_addresses) over () as percentage
from balance_table
where rounded_amount >= 0
group by 1
Run a query to Download Data