Muzeinstructions
Updated 2023-04-13
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 instructions as (
select
date_trunc('day', a.block_timestamp) as day,
'Token Deposits' as instruction,
count( * ) as count
from solana.core.fact_transactions a
left join solana.core.fact_events b on a.tx_id = b.tx_id
left join lateral flatten (input => log_messages) as messages
where b.program_id = '4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg'
and b.succeeded
and messages.value::varchar ilike '%Program log: Instruction: tokenDeposit%'
and a.block_timestamp >= '2023-01-01'
group by 1,2
union all
select
date_trunc('day', a.block_timestamp) as day,
'Token Withdrawal' as instruction,
count( * ) as count
from solana.core.fact_transactions a
left join solana.core.fact_events b on a.tx_id = b.tx_id
left join lateral flatten (input => log_messages) as messages
where b.program_id = '4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg'
and b.succeeded
and messages.value::varchar ilike '%Program log: Instruction: tokenWithdraw%'
and a.block_timestamp >= '2023-01-01'
group by 1,2
)
Run a query to Download Data