select avg(contracts_created)
from
(
select count(*) as contracts_created, date_trunc(day,block_timestamp) as dt
from
(
select *
from ethereum.core.fact_traces
where block_number < 15537393
)
where type = 'CREATE'
or type = 'CREATE2'
group by 2
order by 1 desc
)