Pine AnalyticsStreamflow 3
Updated 2024-12-21
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
›
⌄
SELECT
case when claim_amount < 10 then 'a/ Below 10'
when claim_amount < 100 then 'b/ 10-100'
when claim_amount < 1000 then 'c/ 100-1K'
when claim_amount < 10000 then 'd/ 1K-10K'
else 'e/ 10K+' end as claim_amount_group,
count(*) as claimers,
sum(claim_amount) as claim_volume
FROM (
SELECT
signers[0] as claimer,
sum(inner_instruction['instructions'][1]['parsed']['info']['tokenAmount']['amount'] / power(10, 6)) as claim_amount
FROM solana.core.fact_events
where program_id like 'MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N'
and inner_instruction['instructions'][1]['parsed']['info']['mint'] like 'STREAMribRwybYpMmSYoCsQUdr6MZNXEqHgm7p1gu9M'
AND SUCCEEDED
GROUP BY 1
having not claim_amount is null
ORDER BY 2 DESC
)
GROUP by 1
QueryRunArchived: QueryRun has been archived