select
block_timestamp::date as day
,pool_name
,(select avg(PRICE) from ethereum.core.fact_hourly_token_prices where HOUR::date =block_timestamp::date and SYMBOL='WETH') as ETH_PRICE
,count (distinct tx_hash) as swaps
,count (origin_from_address) as wallets
,sum(amount_in_usd) as amount_usd
,sum (amount_usd) over (partition by pool_name order by day ) as growth_usd_volume
,sum (wallets) over (partition by pool_name order by day) as growth_wallets
from ethereum.sushi.ez_swaps
WHERE block_timestamp::date >= CURRENT_DATE - 40
group by 1,2
order by 1