Résumé
I'll explain the modular properties of the generating functions of rank 0 Donaldson-Thomas invariants, equal to D4-D2-D0 BPS indices in Calabi-Yau compactifications of string theory, and their physical origin. These properties can be used to find generating functions up to a finite number of coefficients, the so-called polar terms, which in turn can be fixed using wall-crossing. I'll show how this program is realized for compact one-parameter Calabi-Yau threefolds and 2 units of D4-brane charge, leading to explicit mock modular forms encoding BPS indices. For higher charges, the polar terms remain so far inaccessibble, but I'll present a general solution of modular anomaly equations in terms of indefinite theta series.