select date_Trunc ({{Time_Interval}},block_timestamp) as date,
count (Distinct tx_Id) as Swaps,
count (distinct from_address) as Swappers,
sum (from_amount_usd) as Volume,
avg (from_amount_usd) as Average_Volume,
round (swaps / swappers) as Swaps_Per_Trader,
volume / swappers as Swap_Volume_Per_Trader,
sum (swaps) over (order by date) as Cumulative_Swaps,
sum (Volume) over (order by date) as Cumulative_Volume
from thorchain.defi.fact_swaps
where block_timestamp >= '{{Start_Date}}' and block_timestamp <= '{{End_Date}}'
and blockchain ilike '{{Blockchain}}'
group by 1
order by 1 desc