with info as (
select
date_trunc('day', block_timestamp) as "Day",
count(distinct pool_address) as "Active Staking Pool"
from near.core.dim_staking_actions
where "Day" between '2022-07-01' and '2022-09-30'
group by 1
),
avg_info as (
select avg("Active Staking Pool") as "AVG Active Staking Pool"
from info
)
select *
from info, avg_info