marquMango v4 - [activity] daily actions
Updated 2023-04-16
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
›
⌄
with
mango as (
select
block_timestamp,
regexp_replace(f.value, '^Program log: Instruction: ') as label_action
from solana.core.fact_events
inner join solana.core.fact_transactions
using(tx_id, block_timestamp, succeeded)
inner join lateral flatten (input => log_messages) f
where succeeded
and program_id = '4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg'
and block_timestamp > '2022-12-08'
and f.value like 'Program log: Instruction: %'
),
aggregated as (
select
date_trunc('day',block_timestamp) as date,
label_action,
count(1) as actions,
row_number() over (partition by date order by actions desc) as rank
from mango
group by 1,2
)
select
date,
iff(rank < 5, label_action, 'Other') as label_action,
Run a query to Download Data