select
block_timestamp::date as fecha,
inner_instruction:instructions[0]:parsed:type as type,
sum(inner_instruction:instructions[0]:parsed:info:amount/pow(10,9)) as staked_mSOL
from solana.fact_events
where block_timestamp::date >= '2022-03-01' and block_timestamp::date < '2022-04-01'
and instruction:programId = 'MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD' --Marinade
and inner_instruction:instructions[0]:programId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
GROUP BY fecha, type