We consider the long-term dynamics of nonlinear dispersive waves in a finite periodic domain. The purpose of the work is to show that the statistical properties of the wave field rely critically on the structure of the discrete resonant manifold (DRM). To demonstrate this, we simulate the two-dimensional MMT equation on rational and irrational tori, resulting in remarkably different power-law spectra and energy cascades at low nonlinearity levels. The difference is explained in terms of different structures of the DRM, which makes use of recent number theory results.