We introduce a theory for the stability of a condensate in an optical lattice. We show that the understanding of the stability-to-ergodicity transition involves the fusion of monodromy and chaos theory. Specifically, the condensate can decay if a connected chaotic pathway to depletion is formed, which requires swap of seperatrices in phase-space.