Mohegan, you need to search your feelings. Ariakas could be right that your impossible definition of "confidence" could be the perfect catalyst for depression (telling yourself you can only be confident if you are "the best" at something - overall confidence is a ghost then, no one can be the best at everything all the time!).
Redpepper could also be right that "the affair" (a definition that acknowleges he broke your trust) could be the cause of your depression. But it could be both, or something else. Only you (through self-reflection or therapy or both) can determine this.