SocioCryptoPlatforms Users interacted with
Updated 2023-10-19
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
›
⌄
-- program_id : MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA
-- 2023-02-07 14:19:25.000
with margin_users as (
SELECT
DISTINCT signers[0] as user
FROM solana.core.fact_events
WHERE program_id = 'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA'
AND block_timestamp::date >= '2023-02-07'
)
,
main as (
SELECT
label,
count(DISTINCT signers[0]) as count_user,
count(DISTINCT tx_id) as n_action
FROM solana.core.fact_events a
JOIN solana.core.dim_labels b ON a.program_id = b.address
WHERE signers[0] IN (SELECT user FROM margin_users)
AND block_timestamp::date >= '2023-02-07'
AND label != 'solana'
GROUP BY label )
SELECT
label,
case when label = 'marginfi' then 1 else 0 end as sub_label,
count_user,
100 * count_user / (f.margin_user) as rate_of_user,
n_action / count_user as n_action_per_user
FROM main
CROSS JOIN (
SELECT
count(DISTINCT user) as margin_user
FROM margin_users
) as f
ORDER BY count_user DESC
Run a query to Download Data