jackguyNear SBT 2
Updated 2023-07-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 tab1 as (
SELECT
signer_id as a,
min(date_trunc('week', block_timestamp)) as week1
FROM
near.core.fact_actions_events
WHERE receiver_id = 'registry.i-am-human.near'
AND action_data:method_name = 'sbt_mint'
GROUP BY 1
ORDER BY 2 DESC
), tab2 as (
SELECT
TX_SIGNER as b,
min(date_trunc('week', block_timestamp)) as week2
FROM
near.core.fact_transactions
WHERE TX_SIGNER in (SELECT a from tab1)
GROUP BY 1
ORDER BY 2 DESC
)
SELECT
wallet_age_weeks,
count(*) as users
FROM (
SELECT
datediff('week', week2, week1) as wallet_age_weeks,
*
FROM tab1
LEFT outer JOIN tab2
on a = b
Run a query to Download Data