The Step Pyramid of Djoser in Saqqara, Egypt, is considered the oldest of the seven monumental pyramids built about 4,500 years ago. From transdisciplinary analysis, it was discovered that a hydraulic lift may have been used to build the pyramid. Based on our mapping of the nearby watersheds, we show that one of the unexplained massive Saqqara structures, the Gisr el-Mudir enclosure, has the features of a check dam with the intent to trap sediment and water. The topography beyond the dam suggests a possible ephemeral lake west of the Djoser complex and water flow inside the 'Dry Moat' surrounding it. In the southern section of the moat, we show that the monumental linear rock-cut structure consisting of successive, deep compartments combines the technical requirements of a water treatment facility: a settling basin, a retention basin, and a purification system. Together, the Gisr el-Mudir and the Dry Moat's inner south section work as a unified hydraulic system that improves water quality and regulates flow for practical purposes and human needs. Finally, we identified that the Step Pyramid's internal architecture is consistent with a hydraulic elevation mechanism never reported before. The ancient architects may have raised the stones from the pyramid centre in a volcano fashion using the sediment-free water from the Dry Moat's south section. Ancient Egyptians are famous for their pioneering and mastery of hydraulics through canals for irrigation purposes and barges to transport huge stones. This work opens a new line of research: the use of hydraulic force to erect the massive structures built by Pharaohs.