I was trying to understand two different approaches to $p$-adic modular forms. First, there is Katz's definition of modular forms. Given a prime $p>5$ (the condition is not necessary for the definition), $N>3$ an integer (the condition on $N$ must be introduced to ensure that the corresponding moduli problem gives rise to a fine moduli scheme), another integer $k$ and a ring $R$ where $N$ is invertible, we call an holomorphic modular form of weight $k$ and level $\Gamma_1(N)$ a global section of the invertible sheaf $\pi_\ast(\Omega_{E/X_1(N)})$, where $X_1(N)$ is the compactified modular curve over $R$ parametrizing generalized elliptic curves with level $N$-structure, i.e. a trivialization of the $N$-torsion subgroup scheme of the elliptic curve, and $E$ is the universal (generalized) elliptic curve given by the representability of the moduli problem. Notice that here I'm thinking about the compactified modular curve. This definition is very powerful, it allows to work over almost arbitrary rings, and to introduce some special modular forms like the Hasse invariant, which allows to talk about overconvergent modular forms in the $p$-adic situation.
On the other side, I found another definition, which seems to be really more general, at least in the $p$-adic setting, but I cannot see the precise connection. In the definition I'm trying to recall, the main difference, and what astonishes me, is in the notion of the level, which is in some sense adelic. Consider a compact open subgroup $K\subset GL_2(\mathbb{A}_f)$, where $\mathbb{A}_f$ is the adele ring of $\mathbb{Q}$, and consider the modular curve of level $K$ as a scheme over $\mathbb{Q}$ equipped with a compactification $X_K$. So, first of all, what is this object, is it the solution of any moduli problem? Does this notion include (in some sense) the definition given by Katz. Then, what are modular forms in this case? And, is it possible to define a notion of overconvergence also in this setting? How the $p$-adic situation can be recovered with this setting? I'm looking for some reference but mainly I'm looking for a hint to understand the connection between the two definitions. Thank you very much!