The equilibrium reaction involving diamond is
Examining the oxygen fugacity of the upper mantle and transition enables us to compare it with the conditions (equilibrium reaction shown above) required for diamond formation. The results show that the  is usually 2 units lower than the carbonate-carbon reaction which means favoring the formation of diamond at transition zone conditions. 
It has also been reported that pH decrease would also facilitate the formation of diamond in Mantle conditions. 
where the subscript aq means aqueous, implying H is dissolved in the solution. 
Deep diamonds have become important windows to look into the mineralogy of the Earth's interior. Minerals not stable at the surface could possibly be found within inclusions of superdeep diamonds-- implying they were stable where these diamond crystallized. Because of the hardness of diamonds, the high pressure environment is retained even after transporting to the surface. So far, these superdeep minerals brought by diamonds include ringwoodite, ice-VII,  cubic δ-N and Ca-perovskite.