Abstract:The Jurassic Shaximiao Formation and Triassic Xujiahe Formation in the Sichuan Basin serve as key replacement areas for increased storage and production of onshore tight gas resources. They possess substantial reserves that are challenging to exploit and hold significant exploration and development potential. However, extensive and ongoing exploratory drilling and development have led to significant water production from wells in both the shallow Shaximiao Formation and the deeper Xujiahe Formation gas reservoirs. This water production has severely constrained the gas production capacity of these wells, with some wells even ceasing production due to water flooding. This study conducted an analysis of the formation water from 34 gas wells at various stratigraphic levels in the study area, focusing on major and trace elements, as well as the evolutionary characteristics of the reservoirs. The results indicate that both the Shaximiao Formation and the Xujiahe Formation gas reservoirs underwent an evolutionary process of initial formation, subsequent compaction, and subsequent modification. Fault connectivity resulted in significant upwelling of formation water from the deep Xujiahe Formation, leading to substantial infiltration into highly permeable sand bodies adjacent to faults. Under the influence of hydrodynamics and other driving forces, natural gas efficiently migrated vertically along fault zones in either a free or dissolved phase. Vertically, the majority of ion concentrations increased progressively with depth. The deep Xujiahe Formation gas reservoirs exhibit favorable conditions for oil and gas preservation and have undergone more complex water-rock interactions, causing varying degrees of enrichment in elements such as K, Ba, Sr, Li, and Rb.