About 16.3 million years ago, the calm of ancient North America was shattered by the eruption of a supervolcano. Along what is now the state line between Oregon and Nevada, thousands of cubic kilometers of magma erupted, collapsing the supervolcano and leaving only a giant hole in the ground.

Now known as the McDermitt caldera, this supervolcano eruption was the work of a hotspot, an unusually hot part of the Earth’s mantle. As the North American tectonic plate has shifted, the hotspot has moved East — we now know it as Yellowstone National Park. But what the hotspot left behind could be just as important, especially as humanity prepares to navigate a world with dwindling fossil fuels. The McDermitt caldera holds the largest known deposit of lithium in the United States.

“The demand for lithium is exponentially increasing,” Stanford researcher Tom Benson tells Inverse. The element is the core component of lithium-ion batteries, which power cellphones, laptops, and electric vehicles like the Tesla. “While the current estimates for consumption through 2050 are very variable, they are likely to be on the very high end of what they are expecting.”

Lithium is relatively rare, with the overwhelming majority of deposits in Australia and Chile. But Benson and his colleagues’ research, which appears Wednesday in Nature Communications, suggests the United States could have vast, untapped lithium deposits in the calderas that dot the western states. There’s something oddly appropriate about swapping fossil fuels, which were formed by geologic processes over hundreds of millions of years, for lithium-powered batteries that trace back to supervolcano eruptions tens of millions of years ago.

So where does all the lithium come from? As magma cools, minerals form that incorporate the various elements brought up in the initial eruption. Lithium is incompatible, though, meaning it’s left separate from the mixed-together materials that crystallize into minerals. Benson compares it to eating all the M&Ms in a bag except for the yellow ones. Once all the other colors have been scarfed down, you’re left with a bag full of yellow M&Ms.

“You’re going to be left with a magma chamber that’s enriched with lithium,” he says. “And so when that magma chamber erupts in the supervolcano eruption, you have a relatively abundant amount of lithium that’s in the volcanic product that’s sitting on the surface.”

Many calderas fill with water, forming lakes in the craters of the supervolcanoes. The most famous example of that, naturally enough, is Oregon’s Crater Lake. The water can help suck up all the lithium, accummulating sediments rich in the stuff.

Not every supervolcano leaves behind such bountiful lithium, to say nothing of other rare metals that are essential to building the 21st century energy infrastructure. But the calderas along the relatively thick crust found in the western United States are particularly good candidates for such deposits, and Benson says most of them remain unexplored. With lithium demand set to skyrocket, that figures to change in a hurry.

“There are hundreds of these calderas that form and occur throughout the western United States alone,” he says. “Some of them are buried, some of them are poorly preserved, some of them are well preserved. But they are out there.”