Afonso_Diaz2023-08-01 10:18 PM
Updated 2023-08-02
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
date_trunc('week', block_timestamp)::date as week,
case
when log_messages[1] ilike 'Program log: Instruction: InitializeAccount%' then 'Create Account'
when log_messages[1] ilike 'Program log: Instruction: IncreaseStorage%' then 'Increases Storage'
when log_messages[1] ilike 'Program log: Instruction: DecreaseStorage%' then 'Decreases Storage'
when log_messages[1] ilike 'Program log: Instruction: IncreaseImmutableStorage%' then 'Increase Immutable Storage'
when log_messages[1] ilike 'Program log: Instruction: MakeAccountImmutable%' then 'Make Account Immutable'
when log_messages[1] ilike 'Program log: Instruction: RequestDeleteAccount%' then 'Request Delete Account'
when log_messages[1] ilike 'Program log: Instruction: DeleteAccount%' then 'Success Delete Account'
when log_messages[1] ilike 'Program log: Instruction: UnmarkDeleteAccount%' then 'Cancel Delete Account'
end as event,
count(distinct tx_id) as transactions,
count(distinct case
when log_messages[1] ilike 'Program log: Instruction: DeleteAccount%'
then replace(log_messages[2], 'Program log: Deleting StorageAccount account: ', '')
else signers[0]
end) as users,
sum(transactions) over (partition by event order by week) as cumulative_transactions
from solana.core.fact_transactions
where log_messages[0] like 'Program 2e1wdyNhUvE76y6yUCvah2KaviavMJYKoRun8acMRBZZ%'
and signers[0] != 'E9gtcGSYWNAUGEg9MT8fHBEWeEZWRia7EafbxvBGChxd'
and log_messages[1] ilike any (
'Program log: Instruction: IncreaseImmutableStorage%',
'Program log: Instruction: MakeAccountImmutable%',
'Program log: Instruction: DecreaseStorage%',
'Program log: Instruction: DeleteAccount%',
'Program log: Instruction: RequestDeleteAccount%',
'Program log: Instruction: InitializeAccount%',
'Program log: Instruction: IncreaseStorage%',
'Program log: Instruction: UnmarkDeleteAccount%'
)
and block_timestamp::date >= current_date - 90
and succeeded = 1
group by 1, 2
order by 1, 2
Run a query to Download Data