Magnetars, highly-magnetic neutron stars, can produce up to 10% of the universe's gold, silver, and platinum.Astronomers observed kilonova explosion in 2017, producing rare heavy elements and answering origins of precious metals.Research explains how flares on magnetars create rapid-process elements like gold and platinum.Magnetars have intense magnetic fields and when those fields snap, it results in powerful flares.Mechanism behind giant flares on magnetars involves dissipation of magnetic field and shockwaves.Giant flares have been observed releasing energies greater than the Sun and creating heavy elements.These magnetar flares contribute 1-10% of all rapid-process elements in the universe.Magnetars, although rare, have a significant impact on the production of heavy elements.Magnetars would have been dominant in producing these elements early in the universe's history.Other environments like certain supernovae may also contribute to the formation of heavy elements.