WITH users AS (SELECT DISTINCT swapper
FROM algorand.swaps
WHERE date(block_timestamp) BETWEEN '2022-05-01' AND '2022-06-30')
SELECT COUNT(DISTINCT address) as no_of_users, sum(balance) as cumulative_algo_balance_of_dex_swappers
FROM algorand.account
WHERE address IN (SELECT * FROM users)