with wallets as (
select
inner_instruction:instructions[1]:parsed:info:authority as wallets_preordered
from solana.core.fact_events where program_id='781wH11JGQgEoBkBzuc8uoQLtp8KxeHk1yZiS1JhFYKy' and succeeded='TRUE'
and block_timestamp>= '2022-06-23'
)
select
wallets_preordered,
count(tx_id) as activity_in_nfts
from wallets,solana.core.fact_nft_sales where purchaser=wallets_preordered and succeeded='TRUE'
GROUP BY 1
ORDER BY 2 desc