STAKED_RANGE | USER_COUNT | |
---|---|---|
1 | 0.01 - 0.05 | 540 |
2 | < 0.01 | 3278 |
3 | 0.05 - 0.1 | 52 |
4 | > 0.1 | 104 |
Sbhn_NPpreliminary-magenta
Updated 2025-01-14
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 deposit AS (
SELECT
origin_from_address,
SUM(
ethereum.public.udf_hex_to_int(
regexp_substr_all(SUBSTR(DATA, 3, LENGTH(DATA)), '.{64}')[0]
) / POWER(10, 18)
) AS deposited
FROM ink.core.fact_event_logs
WHERE topic_0 = '0x90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15'
AND origin_to_address = '0xcab283e4bb527aa9b157bae7180fef19e2aaa71a'
GROUP BY origin_from_address
),
withdraw AS (
SELECT
origin_from_address,
SUM(
ethereum.public.udf_hex_to_int(
regexp_substr_all(SUBSTR(DATA, 3, LENGTH(DATA)), '.{64}')[0]
) / POWER(10, 18)
) AS withdrawn
FROM ink.core.fact_event_logs
WHERE topic_0 = '0x6c3a45613039e0a1117bd6ce110ab3c920271709c010983d921a2cd268e2ea47'
AND origin_to_address = '0xcab283e4bb527aa9b157bae7180fef19e2aaa71a'
GROUP BY origin_from_address
),
current_staked_data AS (
SELECT
COALESCE(a.origin_from_address, b.origin_from_address) AS "User",
COALESCE(deposited, 0) AS deposited,
COALESCE(withdrawn, 0) AS withdrawn,
COALESCE(deposited, 0) - COALESCE(withdrawn, 0) AS current_staked
FROM deposit a
FULL JOIN withdraw b
ON a.origin_from_address = b.origin_from_address
)
Last run: 3 months ago
4
69B
9s