with stars_price as
(
select
recorded_at::date as "date",
symbol as stars_symbol,
avg(price) as stars_price,
avg(volume_24h) as stars_volume
from osmosis.core.dim_prices
where 1=1
and symbol='STARS'
and recorded_at > '2022-09-12'
group by "date",stars_symbol
),
atom_price as
(
select
recorded_at::date as "date",
symbol as atom_symbol,
avg(price) as atom_price,
avg(volume_24h) as atom_volume
from osmosis.core.dim_prices
where 1=1
and symbol='ATOM'
and recorded_at > '2022-09-12'
group by "date",symbol
)
select s.*,b.* from stars_price s inner join atom_price b on s."date"=b."date"