Squeeze treatments are one of the most common methods to prevent oilfield scale deposition, which in turn is one of the most significant flow assurance challenges in the oil industry. Squeeze treatments consist of the batch injection of a chemical scale inhibitor (SI), which above a certain concentration, commonly known as MIC (Minimum Inhibitor Concentration), prevents scale deposition. The most important factor in a squeeze treatment design is the squeeze lifetime, which is determined by the volume of water or days of production where the chemical return concentration is above MIC, which commonly is between 1 and 20ppm. Typically, squeeze treatment designs include the following four stages: a preflush, acting as a buffer; the main slug, where the main chemical slug is injected; the overflush, which will displaced the chemical pill deeper into the formation and finally, a shut-in stage, which allows the chemical to be further retained in the formation.The main purpose of this paper is to describe the automatic optimization of squeeze treatment designs using an optimization algorithm, in particular, using particle swarm optimization (PSO). The algorithm provides the optimum design for a given set of criteria that are used in a purpose built reactive transport model of the near-wellbore area. Every squeeze design is fully determined by a number of parameters; namely, injected inhibitor concentration, main slug volume, overflush volume and shut-in time. The parameter space is bound to certain limits, which will be determined by the maximum injected concentration, main slug and overflush volumes. The maximum injected concentration might be determined by, amongst other issues, logistics, economics and/or compatibility with other chemicals. The main slug and overflush maximum volumes may be identified by the well engineer based on concerns of water formation damage, hydrate formation and/or gas lifting limitations, which might be lower for high value wells. This approach still requires engineering input and review, but speeds up the process of finding an optimum design, and reduces risk of non-optimal squeeze treatments being performed.