The Cordyceps mushroom, an exotic fungus, grows by infecting insects with its spores. The spores use the animals’ bodies as all-you-can-eat buffets, feasting on their flesh. This parasitic relationship ends only when the spores fully grow and mature, sprouting out and mercilessly killing their hosts. Despite its unorthodox but popular survival method—Cordyceps are the inspiration behind some apocalyptic films and video games—the mushroom has some sought-after medicinal properties. For years, scientists have attempted to replicate this process in the lab, because the mushroom is hard to find in the wild. Using brown rice, a common experimental substitute for bugs, often fell short.

It turns out the best way to grow the ever-elusive Cordyceps mushroom is on the backs of fatty insects, finds a new study published Wednesday in Frontiers in Microbiology. Cultivating this rare species of fungus could increase the availability of a bioactive compound called cordycepin, which boasts potential antiviral and antitumor properties.

“Cordycepin has diverse biological effects such as anticancer and anti-inflammation, several aspects that must be considered for the treatment of diseases,” explains Mi Kyeong Lee, a professor of pharmacy at Chungbuk National University in South Korea and senior study author. “In addition, Cordyceps mushrooms may be widely used for prevention of diseases through immune enhancement.” 

Lee’s interest in the fungi came after searching for bioactive ingredients from natural products. However, Cordyceps mushrooms are rare in nature, and when grown on brown rice the fungus produces little cordycepin, perhaps because the grain has low protein content. In the outside world, Cordyceps mushrooms prefer snacking on insects and the study authors hypothesized they may prefer insects with a high protein content. “In particular, insects have recently been approved as a protein substitute in Korea,” Lee says. 

In the new study, Lee and his team sought to replicate how Cordyceps mushrooms grow in the wild with the goal of maximizing cordycepin levels. But first they would need to know whether the type of insect it ate mattered.

[Related: This deadly mushroom can literally shrink your brain—and it’s probably more widespread than we thought]

The team collected an assortment of insects—crickets, silkworm pupae, grasshoppers, Japanese rhinoceros beetles, mealworms, and white-spotted flower chafer larvae—exposed to the spores of the Cordyceps mushroom. The fungi grew for two months with the largest ones coming out of the bodies of silkworm pupae and mealworms. Mushrooms that bloomed out of chafer larvae and grasshoppers grew the smallest mushrooms. 

The size of the fungus, though, doesn’t matter for cordycepin levels. Cordyceps mushrooms that sprouted out of Japanese rhinoceros beetles were the most rich in the cordycepin compound, which had nearly 100 times more cordycepin than those grown out of brown rice. And compared to the giant mushrooms from silkworm pupae, Cordyceps cultivated from Japanese rhinoceros beetles had 34 times more cordycepin.

It was not the amount of protein that made a difference, the scientists determined, but the fat content in the invertebrates. Insects with high amounts of a fatty acid called oleic acid seemed to make more cordycepin. (For example, the Japanese rhinoceros beetle held 10.8 percent of oleic acid while silkworms only had 0.4 percent of oleic acid.)

What’s more, genes involved in the production of cordycepin, cns1 and cns2, were found at higher levels in the beetle than the other insects. Adding oleic acid to a low-performing insect raised cordycepin levels by 50 percent.

[Related: A South Pacific island could help us understand how fungi evolve]

“Raising medicinal fungi on farmed insects is a more sustainable practice than collecting these species in the wild,” notes Nicholas P. Money, a mycologist at Miami University in Ohio who was not affiliated with the study. However, he warns that “the clinical benefits of the metabolite examined in this study”–referring to cordycepin–“remain a matter of faith rather than science.” Ongoing research suggests cordycepin may have the potential to ward off viruses such as influenza and SARS-CoV-2 by acting as an inhibitor for viral replication as well as mitigating any severe symptoms by lowering inflammation levels. However, there is a lack of evidence from preclinical and clinical studies to support these claims.

Yet with an improved supply of Cordyceps, which the new work aims to provide, researchers will have an easier time studying its therapeutic potential. Lee says his goal is to find the optimal living environment for producing the highest quality of Cordyceps mushrooms. His next work will test different plant species as another possible breeding ground for the fungi to grow.