Millions in tax revenue has been collected after more than 20,000 undeclared pools were found.