Current proton therapy scanning systems always use two inde-pendent dipole magnets for spot scanning in proton therapy. However, the space occupied by these two dipole magnets locat-ed after the final gantry bending magnets is very large and in-creases the overall size of the gantry. In order to construct a compact nozzle and decrease the size of the gantry, we decide to design an octupole scanning magnet to replace these two sepa-rate dipole magnets. The octupole scanning magnet, which is completely different from traditional octupole magnet, can gen-erate rotating dipole magnetic field with the change of the load-ed sinusoidal current phases. In the paper, we have finished the static optimization of an octupole scanning magnet model, in-cluding the length and shape of the poles, the diameter of the gap and the shims on the pole edges, both in Opera 2D and 3D. The corresponding relationship between the size of the gap and the good field region was also studied. The effect of eddy cur-rents on magnetic field stability was also simulated in Opera 3D. All the simulation results are presented in the paper.