The copious number of $D^0$ decays collected by the LHCb experiment during 2011--2016 allows testing the violation of the $CP$ symmetry in the decay of charm quarks with unprecedented precision, approaching for the first time the expectations of the Standard Model. We present the latest measurements of LHCb of mixing and indirect $CP$ violation in the decay of $D^0$ mesons into two charged hadrons. All the results for $y_{CP}$, $A_\Gamma$ and mixing and $CP$ violation with $D^0 \rightarrow K^\pm\pi^\mp$ decays are the most precise to date and are still limited by the statistical uncertainty. No evidence of $CP$ violation has been found yet.