select
date_trunc('day', block_timestamp) as date,
blockchain,
count(distinct tx_id) as swaps,
count(distinct from_address) as users,
sum(from_amount_usd) as volume,
from thorchain.defi.fact_swaps
where date_trunc('day', block_timestamp) > current_date - 30
group by 1 , 2
order by 1 desc