select
date_trunc('day', block_timestamp) as day,
sum(event_inputs:amount/pow(10,18)) as amount_matic,
count(distinct ORIGIN_FROM_ADDRESS) as users,
sum(users) over (order by day) as total_users,
count(distinct tx_hash) as bridge_count
from ethereum_core.fact_event_logs
where
event_name = 'TransferSentToL2' and contract_address = lower('0x22B1Cbb8D98a01a3B71D034BB899775A76Eb1cc2') and date_trunc('day', block_timestamp) >= CURRENT_DATE - 180
group by day