select
count(distinct from_address) as swappers,
count(Distinct tx_id) as transactions,
sum(case when not FROM_AMOUNT_USD is null then FROM_AMOUNT_USD else to_AMOUNT_USD end) as swap_volume_Usd
from maya.defi.fact_swaps
where BLOCK_TIMESTAMP > current_date - 30