A boom in cannabis investment is siphoning capital away from mining and hitting junior miners hardest, forcing them to up their game and potentially improving the quality of projects in a sector long rife with cowboy speculators.

Canada’s relaxation of cannabis laws culminated in legalisation for recreational use in October. Other jurisdictions are following suit or liberalising their laws on medical or health use, creating an industry that has lured a breed of high-risk, high-return investors.

The world’s top three listed cannabis companies – Canopy Growth, Tilray and Aurora Cannabis – have a combined market value of around $30 billion.

Consumers are expected to spend over $7 billion on cannabis products in Canada alone this year, according to Deloitte.

In Africa, where miners met this week for Cape Town’s African Mining Indaba conference, cannabis companies are setting up projects in Lesotho, while other countries, including Zimbabwe and South Africa, plan to issue license.

Goldfields vice president, Svene Lunsche told Reuters that 50% of the company’s gold shafts are not profitable and that is scaring investors away.

“Gold equities worldwide haven’t done well but they’ve done better than the South African ones. And we know the South African issues that we are beleaguered with; heavy trade union activism, we have uncertainty in terms of mining legislation, in terms of the charter, in terms of the MPIDA. We have high costs, huge cost base – most of the gold mines in South Africa are 2 to 3 kilometres underground, with it comes huge costs. Electricity, 10 years ago we were the cheapest in the world, now we one of the most expensive in the world in terms of electricity, labour costs, the cost base is just going through the roof so it is tough doing business in South Africa,” he said.

The rise of cannabis comes at a time when investors were already turning away from mining.

Miners operating in Africa – already viewed by many investors as a particularly risky bet – have been doubly hit.

“It’s like the straw that broke the camel’s back,” said one explorer at the Indaba.

As early IPOs, once a right of passage for exploration juniors have slowed to a trickle with cannabis stocks delivering better short-term returns, miners are increasingly turning to private equity.

And as active investors replace passive stockholders, companies are having to sell the merits of their projects to more discerning potential backers.

The CEO of Barrick Gold, one of the world’s biggest gold companies, said mining’s struggles to fend off the challenge from cannabis reflected the poor state of the industry in the eyes of prospective investors.

“What good does cannabis do? And so you know and that’s where for… we should be embarrassed that somebody is prepared to make a choice between those two options,” Mark Bristow told Reuters.

Majors such as Barrick and companies with projects already in production can better weather the storm. The newest juniors in the riskiest areas are racing to adapt and some are getting creative.

Prospect Resources’ executive director Harry Greaves on Wednesday won an award at the Indaba for his lithium project in Zimbabwe. He said Australian and Chinese investment had helped. And he was also considering growing cannabis at his lithium site on the outskirts of Zimbabwe’s capital Harare.