with sol_price as (
select date_trunc('day', hour) as date,
avg(price) as price
from ethereum.token_prices_hourly
where token_address = lower ('0xD31a59c85aE9D8edEFeC411D448f90841571b89c')
and date_trunc('day', hour) >= CURRENT_DATE - 180
group by 1),
transactions_ as (
select block_timestamp::date as date,
count( tx_id) as num_transactions
from solana.core.fact_transactions
where block_timestamp::date >= CURRENT_DATE - 180
and succeeded =true
group by 1)
select date ,
price,
num_transactions
from sol_price join transactions_ using (date)
group by 1,2,3