  For an odd prime $p$ and an unramified maximal torus $H $ of
$\mathrm{GL}_{2/\mathbf{Q}_p}$, inspired by work of Loeffler-Skinner-Zerbes, we
construct natural $H(\mathbf{Q}_p)$-stable lattices in spaces of functions on
$\left(\mathrm{GL}_2\times H\right)(\mathbf{Q}_p)$ and positively answer a
conjecture of Loeffler. These local lattices give rise to canonical Hecke
operators in local spherical Hecke algebras, that enjoy certain integrality
properties away from $p$, with respect to equivariant maps into any smooth
$\mathrm{GL}_2(\mathbf{Q}_p)$-representation. In the process, we also obtain
integral results on $H$-invariant periods for local unramified Whittaker type
representations, and global automorphic representations attached to cuspidal
Hecke eigenforms.
