  We give a categorical formulation of the $p$-adic local Langlands
correspondence for $\mathrm{GL}_2(\mathbb{Q}_p)$,as an embedding of the derived
category of locally admissible representations into the category of
Ind-coherent sheaves on the moduli stack of two-dimensional representations of
$\mathrm{Gal}(\overline{\mathbb{Q}}_p/\mathbb{Q}_p)$. Moreover, we relate our
version of the $p$-adic local Langlands correspondence for
$\mathrm{GL}_2(\mathbb{Q}_p)$ to the cohomology of modular curves through a
local-global compatibility formula.
