We consider graded Cartan matrices of the symmetric groups and the Iwahori-Hecke algebras of type A, which have entries in the ring Z[v,v−1]. These matrices may also be interpreted as Gram matrices of the Shapovalov form on sums of weight spaces of a basic representation of an affine quantum group. We present a conjecture predicting the invariant factors of these matrices and give evidence for the conjecture by proving its implications under a localization and certain specializations of the ring Z[v,v−1]. This proves and generalizes a conjecture of Ando-Suzuki-Yamada on the invariants of these matrices over Q[v,v−1] and also generalizes the first author's recent proof of the Külshammer-Olsson-Robinson conjecture over Z.