A system and process is provided for optimizing chemical additions, mixing energy, mixing time, and other variables while treating a contaminated liquid stream. Samples from the contaminated liquid stream are tested to determine the optimal parameter for each variable, including type and amount of the chemicals to be added, chemical sequence, mixing energy, mixing time, temperature, and pressurization. A system of mixers, a flotation chamber, and a dewatering subsystem are designed to achieve optimal turbidity of the wastewater stream. The system can be modified in real-time in response to a continually changing contaminated liquid stream via a controller and set of sensors, valves, and ports.