with lst_tx as (
select tx_id as txs
from solana.core.fact_events
where program_id ='SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC'
and SUCCEEDED = true
)
select
count(DISTINCT tx_id) as tx_count
,count(DISTINCT INSTRUCTION:parsed:info:owner::string) as wallets
,sum(inner_instruction:instructions[0]:parsed:info:amount) /pow(10,8) as volume
from solana.core.fact_events
where
SUCCEEDED = TRUE
and tx_id in (select txs from lst_tx )