princefarzamHas the volt become more prevalent for whales or average Solana wallets?
Updated 2022-03-27
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 txns AS (
SELECT
DISTINCT tx_id
FROM solana.events
WHERE INSTRUCTION:parsed:info:mint::string='3BjcHXvyzMsjmeqE2qFLx45K4XFx3JPiyRnjJiF5MAHt'
AND INDEX=0
AND block_timestamp >= '2022-01-28'
AND SUCCEEDED =TRUE),
addresses AS (SELECT
INSTRUCTION:accounts[0]::string AS address,
Sum(CASE
WHEN INNER_INSTRUCTION:instructions[1]:parsed:info:amount IS NOT NULL THEN INNER_INSTRUCTION:instructions[1]:parsed:info:amount /1e6
WHEN INNER_INSTRUCTION:instructions[1]:parsed:info:amount IS NULL THEN INNER_INSTRUCTION:instructions[0]:parsed:info:amount /1e6
END) AS amount_in_BTC
FROM solana.events E INNER JOIN txns T ON E.tx_id = T.tx_id
WHERE INDEX = 1
AND inner_instruction IS NOT NULL
GROUP BY 1
ORDER BY 2 DESC)
SELECT
COUNT(address) AS Number_of_addresses,
CASE
WHEN amount_in_BTC >= 1 THEN 'Whales'
WHEN amount_in_BTC < 1 AND amount_in_BTC >= 0.5 THEN 'Dolphins'
WHEN amount_in_BTC < 0.5 AND amount_in_BTC > 0 THEN 'Average wallets'
END AS Category
FROM addresses
GROUP BY 2