KeyrockwALLET TX DISTRIBUTION - SEI
Updated 2024-05-30
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
›
⌄
WITH Wallet_CTE as (
SELECT
tx_from as wallet,
COUNT(DISTINCT FACT_TRANSACTIONS_ID) as total_transactions
FROM
sei.core.fact_transactions
where
TX_SUCCEEDED = TRUE
AND wallet != ''
GROUP BY
tx_from
ORDER BY 2 DESC
LIMIT 50
),
TX_CTE as (
SELECT
COUNT(DISTINCT FACT_TRANSACTIONS_ID) as tot_transaction
FROM
sei.core.fact_transactions
)
SELECT
a.wallet
,a.total_transactions
,(a.total_transactions/b.tot_transaction) *100 as pct_total
,SUM (pct_total) OVER (ORDER BY a.total_transactions DESC) as cumsum_pct
,ROW_NUMBER() OVER (ORDER BY total_transactions DESC) as id
FROM WALLET_CTE a
INNER JOIN TX_CTE b
QueryRunArchived: QueryRun has been archived