Aephiacrafting SAGE & SB
Updated 2024-04-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
27
28
29
30
31
32
33
34
35
36
›
⌄
select --crafting
date_trunc('day', block_timestamp::date) as date
----------------------------------------------------
,zeroifnull(sum(case when inner_instruction:instructions[0]:accounts[5] IN ('Afb3MooPpkZKs485FGT82fcvmHx3jex8eAKynbKy8FeA', '8dvios2LKQcKcvWodSZK33MNpp4N2EVpP4iYZhaJHFPL')
AND inner_instruction:instructions[1]:programId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
AND inner_instruction:instructions[1]:parsed:type = 'transfer'
then inner_instruction:instructions[1]:parsed:info:amount
end)) as FRMWRK_craft
,zeroifnull(sum(case when inner_instruction:instructions[0]:accounts[5] IN ('BTSnmsD3UTVHR71QitMk9m28bsDHDF6awu69c2vhd3iM', '9ej2RgtmkcDzkkCrMJe2y8Kr2Rc9GtpgTzusQSqLcQhQ')
AND inner_instruction:instructions[1]:programId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
AND inner_instruction:instructions[1]:parsed:type = 'transfer'
then inner_instruction:instructions[1]:parsed:info:amount
end)) as ELECTRO_craft
,zeroifnull(sum(case when inner_instruction:instructions[0]:accounts[5] IN ('ACxds7vRps6VZoUDME2dFm3d1axVmvQzQsKGRMJedpYF', '7pW7cuE4s5kUYnhZRocYqXqHYeNs9jNyZPosQqKciNQ5')
AND inner_instruction:instructions[1]:programId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
AND inner_instruction:instructions[1]:parsed:type = 'transfer'
then inner_instruction:instructions[1]:parsed:info:amount
end)) as PWRSRC_craft
,zeroifnull(sum(case when inner_instruction:instructions[0]:accounts[5] IN ('59GmESqnCS28duoix5aDxb2csXsD46Ky9zVgqc9r9kCh', '4zWFbiy7sJSmus6R2oNDVbBtoMLnPZEfux7skW7aGPwr')
AND inner_instruction:instructions[1]:programId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
AND inner_instruction:instructions[1]:parsed:type = 'transfer'
then inner_instruction:instructions[1]:parsed:info:amount
end)) as ELECMAG_craft
---
,sum(FRMWRK_craft) OVER (order by date) as FRMWRK_total_craft
,sum(ELECTRO_craft) OVER (order by date) as ELECTRO_total_craft
,sum(PWRSRC_craft) OVER (order by date) as PWRSRC_total_craft
,sum(ELECMAG_craft) OVER (order by date) as ELECMAG_total_craft
from solana.core.fact_events
WHERE program_id IN ('SAGEqqFewepDHH6hMDcmWy7yjHPpyKLDnRXKb3Ki8e6', 'SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE')
AND inner_instruction:instructions[0]:programId IN ('Craftf1EGzEoPFJ1rpaTSQG1F6hhRRBAf4gRo9hdSZjR', 'CRAFT2RPXPJWCEix4WpJST3E7NLf79GTqZUL75wngXo5')
--AND tx_id = '4Zu8JQZoaq8mgGkgDaw47fTxEJrR28bZAjnU3fQJdD8gLhm7rwNq7dTT5wDh9JzPSWw1EbUQSLCyRZaNqvsTxtzx'
AND block_timestamp > '2023-09-22' --AND block_timestamp < current_date
QueryRunArchived: QueryRun has been archived