I've heard that there's a lot of trace elements in coffee when it breaks down. What trace elements are in the soil that coffee breaks down to?
The trace elements found in coffee include zinc, strontium, manganese, silicon, copper, iron, barium, boron and aluminium. The exact profile depends on where it is grown. All of these should return to the soil, whereas nitrogen can be lost on decomposition.
Coffee: Emerging Health Effects and Disease Prevention 1
spent coffee samples showed high carbon (>58%), low nitrogen (<2%), and low ash (<1%) contents and low polarity coefﬁcient (O + N)/C (<0.5).
All the mineral components are in the ash, so less than 1%, or 10ppm. According to table 1 from the above link, that consists mostly of calcium and sodium with a little magnesium, potassium, and iron in the mix.
Plenty of carbon compounds in there, to add organics to the soil, though.
Composted coffee grounds have a 20:1 C/N (carbon/nitrogen) ratio so they are a "Green" compost (Nitrogen source).
If adding to a compost heap, toss them on and cover with just enough light browns (shredded leaves) to cover them and you're golden.
As far as trace elements go - organics give a boost to a soil's micronutrients, but if you're looking to truly affect a soil's micronutrient levels, you have to use a micronutrient boosting amendment like Lime (use lawn lime, garden lime is slightly more concentrated and 5x the cost, so use lawn lime and just add a little more).
Thick, yearly applications of good compost helps keep micronutrient levels balanced, but if working from a deficit it will take many years, and can't be done with just coffee grounds.
(There is a ton of false info about coffee grounds exploding lately. The reality is that it's just a very good, usually pH neutral or slightly acidic green compost source.)