select
block_timestamp::date as date,
sum(event_inputs:value / power(10, 9)) as rebase_amount,
avg(rebase_amount) over(order by date) as avg_rebase
from ethereum.core.fact_event_logs
where date > current_date - 90
and tx_status = 'SUCCESS'
and contract_address = '0xf59257e961883636290411c11ec5ae622d19455e'
and event_name = 'Transfer'
and origin_function_signature = '0xaf14052c'
group by 1