datavortexwidespread
Updated 2024-12-31
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
›
⌄
⌄
⌄
/*
SELECT
COUNT(DISTINCT account_address) AS "holders",
mint,
SUM(balance) AS balances -- Adjust as needed based on token decimals
FROM
solana.core.fact_token_balances
WHERE
mint = 'GxdTh6udNstGmLLk9ztBb6bkrms7oLbrJp5yzUaVpump'
and balance > 100
GROUP BY
mint
ORDER BY
balances DESC;
*/
/*
SELECT
account_address,
mint,
SUM(balance) AS token_balance -- Adjust based on token decimals
FROM
solana.core.fact_token_balances
WHERE
mint = 'GxdTh6udNstGmLLk9ztBb6bkrms7oLbrJp5yzUaVpump'
and balance > 100
GROUP BY
account_address, mint
ORDER BY
token_balance DESC;
*/
WITH transfer_summary AS (
SELECT
transfer.tx_from AS from_owner,
transfer.tx_to AS to_owner,
SUM(CASE WHEN transfer.tx_to = transfer.tx_to THEN transfer.amount / 1e6 ELSE 0 END) AS total_in,
SUM(CASE WHEN transfer.tx_from = transfer.tx_from THEN transfer.amount / 1e6 ELSE 0 END) AS total_out
QueryRunArchived: QueryRun has been archived