The interplanetary magnetic field (IMF) between the Sun and the Earth induces the displacement
of the cosmic-ray Sun shadow from the optical position. Previously, the average IMF has been
measured by the ARGO-YBJ and the Tibet-AS𝛾 experiments through several years of data.
With the improvement of the sensitivity, the first pool of WCDA in LHAASO, which has been
operated since April 2019, and has observed the Sun shadow with significance exceeds 70 standard
deviation. Using the data collected by WCDA from July 26 to August 22, 2019, we measured the
displacements of Sun shadow at the energy of 6.4TeV every two or three days. Combining with the
simulation of Sun shadow, the IMF is measured and is comparable with the satellite observations.
This is the first time to measure the IMF using Sun shadow in a short period, and the expectation
for space weather forecast is discussed.