STAKE_STATUS | TOTALS | |
---|---|---|
1 | not currently staking | 3755 |
2 | active staker | 38868 |
TheLaughingMannew users + staking (active stakers)
Updated 2 days ago
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 new_users as (
SELECT
block_timestamp
, tx_hash
, from_address as wallet
from ronin.core.fact_transactions
WHERE 1=1
AND nonce=0
AND tx_succeeded
)
, stake_stats as (
SELECT
wallet
, COUNT(DISTINCT tx_hash) as tx_counts
, SUM(CASE WHEN action IN ('stake', 'delegate') THEN amount ELSE amount*-1 END) as net_stake
from community.ronin.staking_actions
WHERE 1=1
AND action IN ('delegate', 'undelegate', 'stake', 'unstake')
GROUP BY 1
)
, merge as (
SELECT
n.*
, coalesce(tx_counts, 0) as tx_count
, coalesce(net_stake, 0) as net_stakes
, CASE WHEN tx_count=0 THEN 'no participation' ELSE 'participated' END as label1
, CASE WHEN net_stakes<=0 THEN 'not currently staking' ELSE 'active staker' END as label2
--from new_users
--LEFT JOIN stake_stats using(wallet)
from new_users n
LEFT JOIN stake_stats s ON n.wallet = s.wallet
)
SELECT
Last run: 1 day ago
2
56B
8s