Abstract We use continuous observation data recorded by OSG superconducting gravimeter before and after the 2021 Yangbi MS6.4 and Maduo MS7.4 earthquakes to extract the gravity residual time series and the signal of coseismic gravity changes through harmonic analysis. The coseismic gravity changes caused by the two earthquakes at Lijiang station are calculated using the spherical dislocation theory at the same time. The results show that the observed and theoretical values of coseismic gravity change differ, the observed values of Yangbi and Maduo earthquakes are -4.37 nm/s2 and 28.57 nm/s2 separately, and the theoretical values are -0.19 nm/s2 and 0.24 nm/s2 separately. Subsequently, we analyze the gravity effects from groundwater. We find that the effect of groundwater is in the same order of magnitude as the theoretical coseismic gravity changes. Finally, we find that the magnitude of coseismic displacement jump before and after the above two earthquakes is much smaller than the magnitude of gravity change by comparing the 30-second sampling data of GPS observation in Lijiang area in the same period with the superconducting gravimeter observation, indicating that the superconducting gravimeter is affected by the pulse signal of the earthquake, leading to a significant increased drift in gravity signals during the two earthquakes.