select
date_trunc('minute', block_timestamp) as time,
case when from_asset = 'THOR.RUNE' then 'Sell RUNE' else 'Buy RUNE' end as type,
sum(from_amount_usd + to_amount_usd)/2 as volume
from flipside_prod_db.thorchain.swaps
where time >= '2021-11-18 18:47:00.000'
and time <= '2021-11-18 19:00:00.000'
group by 1, 2