select
substring(INPUT_DATA, 202, 1) as chain_id,
count(DISTINCT tx_hash) as tx_cnt,
from_address,
sum(amount_usd) as volume
from ethereum.core.fact_transactions join ethereum.core.ez_token_transfers USING(tx_hash)
where to_address in (lower('0x3ee18b2214aff97000d974cf647e7c347e8fa585'))
and origin_function_signature in ( '0x0f5287b0','0x9981509f')
and chain_id = '1'
and block_timestamp >= '2022-10-01'
group by 1,3
order by 2 desc
limit 10