SELECT DATE_TRUNC('month', BLOCK_TIMESTAMP) AS Month,
COUNT(DISTINCT TX_HASH) AS "Total DEX Transactions",
SUM(ABS(amount_in_usd) + ABS(amount_out_usd)) / 2 AS "Total trading volume",
COUNT(DISTINCT origin_from_address) AS "DEX Users"
FROM base.defi.ez_dex_swaps
WHERE 1=1
AND BLOCK_TIMESTAMP >= '2024-01-01' AND
BLOCK_TIMESTAMP<='2024-06-30'
GROUP BY Month