The synthesis of complex organic molecules with C-C bonds is possible under conditions of reduced activity of oxygen. We have found performing ab initio molecular dynamics simulations of the C-O-H-Fe system that such conditions exist at the core-mantle boundary (CMB). H2O and CO2 delivered to the CMB by subducting slabs provide a source for hydrogen and carbon. The mixture of H2O and CO2 subjected to high pressure (130 GPa) and temperature (4000 to 4500 K) does not lead to synthesis of complex hydrocarbons. However, when Fe is added to the system, C-C bonds emerge. It means that oil might be a more abundant mineral than previously thought.