-- select *
-- from polygon.core.fact_token_transfers
-- where tx_hash = '0xf78e85860b6508af5e0de7c51784d014f7b50dc1a29c2b3266a0d59612e0ec17'
--with a as (
select
date_trunc('day', block_timestamp) as date,
case when contract_address = '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619' then 'WETH'
when contract_address = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' then 'USDC'
else 'rest' end as currency,
count(distinct tx_hash) as "count",
count(distinct to_address) as unique_user
--sum(amount_usd) as amount_usd_sum,
from polygon.core.fact_token_transfers
where
origin_from_address = '0x0000000000000000000000000000000000000000' and
origin_to_address = '0x0000000000000000000000000000000000000000' and
from_address = '0x0000000000000000000000000000000000000000'
group by 1, 2