Mrfti2024-01-28 01:59 PM
Updated 2024-04-18
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 tbl AS (
SELECT tx_from AS address
, SUM(-amount) AS net_amount
FROM solana.core.fact_transfers
WHERE mint = 'WENWENvqqNya429ubCdR81ZmD69brwQaaBYY6p3LCpk'
GROUP BY 1
UNION
SELECT tx_to AS address
, SUM(amount) AS net_amount
FROM solana.core.fact_transfers
WHERE mint = 'WENWENvqqNya429ubCdR81ZmD69brwQaaBYY6p3LCpk'
GROUP BY 1
), tbl2 AS (
SELECT address
, SUM(net_amount) AS net_amount
FROM tbl
GROUP BY 1
), tbl3 AS (
SELECT address
, net_amount
FROM tbl2
WHERE net_amount >= 1
)
SELECT
COUNT( DISTINCT address) AS "Total $WEN holders"
, MEDIAN(net_amount) AS "Median amount held",
avg (net_amount) AS "Average amount held"
FROM tbl3
QueryRunArchived: QueryRun has been archived