  We define new invariants of 3d Calabi-Yau categories endowed with a stability
structure. Intuitively, they count the number of semistable objects with fixed
class in the K-theory of the category ("number of BPS states with given charge"
in physics language). Formally, our motivic DT-invariants are elements of
quantum tori over a version of the Grothendieck ring of varieties over the
ground field. Via the quasi-classical limit "as the motive of affine line
approaches to 1" we obtain numerical DT-invariants which are closely related to
those introduced by Behrend. We study some properties of both motivic and
numerical DT-invariants including the wall-crossing formulas and integrality.
We discuss the relationship with the mathematical works (in the
non-triangulated case) of Joyce, Bridgeland and Toledano-Laredo, as well as
with works of physicists on Seiberg-Witten model (string junctions),
classification of N=2 supersymmetric theories (Cecotti-Vafa) and structure of
the moduli space of vector multiplets. Relating the theory of 3d Calabi-Yau
categories with distinguished set of generators (called cluster collection)
with the theory of quivers with potential we found the connection with cluster
transformations and cluster varieties (both classical and quantum).
