A failed crop, followed by a wave of financial speculation, put cocoa prices on a roller coaster this year, rattling an industry reliant on inexpensive crops and labor.

This is not how things normally go in the cocoa market. For much of the past decade, the price of cocoa in one key global benchmark hovered around $2,500 per metric ton. Last year, after poor harvests in West Africa, the price began to creep up — rising to $4,200 a ton by December, a threshold that hadn’t been crossed since the 1970s.

Then the financial speculators began to pile in — betting prices would rise further. They pushed the price above $6,000 a ton in February, $9,000 a ton in March and $11,000 a ton in mid-April. Since then, the price has swung wildly, falling nearly 30 percent in just two weeks before bouncing up again. By Thursday, the price was $8,699 a ton.

Large food companies have been raising prices and warning that they’ll have to continue to do so if cocoa doesn’t stabilize. Companies that use more pure cocoa — rather than the palm oil and other fillers that go into many candy bars — will be hit hardest, though some premium chocolate makers note that they’ve always paid much higher prices in order to compensate farmers fairly.

The situation doesn’t look as if it’s going to settle down soon. Here’s what you need to know.

A combination of low rainfall, plant disease and aging trees led to a disappointing crop in Ivory Coast and Ghana in 2023. The two countries produce about two-thirds of the world’s cocoa, so the shortage hit the global market hard. It continues: The International Cocoa Organization recently forecast that global production will trail demand by 374,000 tons this season, which ends in September, after a 74,000-ton shortfall last year.

There’s no quick fix for this. Cocoa trees take years to produce fruit, giving farmers little incentive to plant more since they don’t know what the price of the crop will be when they bear fruit. Some may prefer to use more of their land for growing rubber or mining gold.