When investing app Openfolio was combing through data from 20,000 of its users, one trend in particular jumped out: Teachers were doing really, really well.

In fact, educators and education administrators at every level of schooling outperformed 80% of all investors over the course of a year, including investors in the tech and finance industries and in government.

Over the course of a year ending in February 2015, Openfolio found that the average investor was up 7.6% ... while on average, teachers had gained 10.2%.

Investors in the technology industry were the next-highest at 8.3%, investors working in finance trailed with 6.9%, and government workers came in last, with 3.4%.

Here, Openfolio has shared some of the lessons to be learned from the unlikely cohort's success.

First of all, teachers kept their hands off their investments. Investment advisor SigFig has found that the most successful investors are the ones who leave their money alone, and the fact that teachers trade 30% less than the average investor while still getting higher returns supports that finding.

The fact that teachers invest most of their assets rather than sitting on cash has also put them ahead of the game. Previously, Openfolio pointed to this same pattern when highlighting why investors in the tech industry were outperforming those in finance.

Also, teachers demonstrate the favorite Buffett strategy of investing in index and mutual funds rather than picking individual stocks. Teachers, it turns out, own more funds, and fewer single stocks, than the average investor.

Finally, while it isn't as clear-cut a lesson as the above conclusions, Openfolio noticed that teachers are more likely than the average investor to put their money in fields like healthcare, pharmaceuticals, and biotechnology, and less likely to invest in financials.

Based on this analysis, it seems to be working.