Mrftinoisy-plum
Updated 2025-02-13Copy Reference Fork
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
›
⌄
WITH user_tx_counts AS (
SELECT
s.value::STRING AS "Address",
COUNT(DISTINCT tx_id) AS "Total_tx"
FROM
eclipse.core.fact_transactions,
LATERAL FLATTEN(input => signers) s
GROUP BY
1
),
user_ranks AS (
SELECT
"Address",
"Total_tx",
NTILE(100) OVER (ORDER BY "Total_tx" DESC) AS percentile
FROM
user_tx_counts
)
SELECT
COUNT(*) AS "Top 1% Users",
MIN("Total_tx") AS "Min tx to be among top 1%"
FROM
user_ranks
WHERE
percentile = 1;
QueryRunArchived: QueryRun has been archived