with swap_volume as (
select
date_trunc('hour', block_timestamp) as swap_volume_time,
sum(from_amount_usd) as swap_volume
from thorchain.swaps
group by swap_volume_time
),
RUNE_price as (
select
date_trunc('hour', block_timestamp) as RUNE_price_time,
avg(rune_usd) as rune_price
from thorchain.prices
group by RUNE_price_time
)
select
swap_volume_time,
swap_volume,
rune_price
from swap_volume
inner join RUNE_price on (swap_volume_time = RUNE_price_time)
order by swap_volume_time desc