satsihNEAR Staking Distributions
Updated 2022-11-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
30
31
32
33
34
35
36
›
⌄
with
near_staking_actions as (
SELECT
b.block_timestamp,
b.method_name,
b.deposit/pow(10,24) as deposit,
a.tx_receiver as validator,
a.tx_signer as stakers
FROM
near.core.fact_transactions a
INNER JOIN
(SELECT
*
FROM
near.core.fact_actions_events_function_call
WHERE method_name = 'deposit_and_stake') b
ON a.tx_hash = b.tx_hash
WHERE deposit > 0
),
validators as (
SELECT
validator,
sum(deposit) as deposit
FROM
near_staking_actions
GROUP BY 1
ORDER BY 2 DESC
)
SELECT
CASE
WHEN cume_dist_val <= 0.25 THEN '75%-100%'
WHEN cume_dist_val > 0.25 AND cume_dist_val <= 0.5 THEN '50%-75%'
WHEN cume_dist_val > 0.5 AND cume_dist_val <= 0.67 THEN '33%-50%'
ELSE '0-33%'
END AS Distribution,
Run a query to Download Data