with opensea_activity as (
select * from ethereum_core.fact_event_logs
where contract_address = '0x495f947276749ce646f68ac8c248420045cb7b5e'
and event_name = 'TransferSingle'
),
foundation_activity as (
select * from ethereum_core.fact_event_logs
where contract_address = '0x3b3ee1931dc30c1957379fac9aba94d1c48a5405'
and event_name = 'Transfer'
)
select
date_trunc('week', block_timestamp) as time,
platform,
count(distinct tx_hash) as number_of_token_transfer
from (
select block_timestamp, 'Opensea' as platform, tx_hash from opensea_activity
union all
select block_timestamp, 'Foundation' as platform, tx_hash from foundation_activity
)
group by 1, 2