select
count( case when soroban_operation_type = 'upload_wasm' then contract_code_hash end) as total_unique_wasm_uploads,
count( case when soroban_operation_type = 'invoke_contract' then contract_id end) as total_unique_contract_invocations
from stellar.core.fact_operations
where soroban_operation_type in ('upload_wasm', 'invoke_contract')
and closed_at >= dateadd('month', -12, current_timestamp);