The oil bust of the past two years crushed profits for most producers, but there was one bright spot on the balance sheets of some of the biggest oil companies: trading. As prices fell beginning in mid-2014, more and more barrels of oil piled up in holding tanks around the world.

As a result, the current—or “spot”—price for those barrels was a lot less than the price on futures contracts to buy them six months later. In the trading world, this pricing picture is known as contango, and for companies that can store and move oil around the world, it can generate big profits that help to offset steep declines in oil prices.

Imagine if you knew that the price of your favorite salsa would cost more in six months. You’d buy up all you could, right? That’s what the big oil companies have been doing with crude oil during the past two years.

Major oil companies have big balance sheets and access to a global network of shipping and storage. Traders for firms like BP or Shell can buy unwanted barrels on the cheap, then lock in higher prices through futures contracts. During the past two years, independent trading firms such as Vitol and Trafigura generated near-record profits from the strategy.

While the major oil companies don’t break out financial results for their trading operations, BP allocated another $1.4 billion to its trading group two years ago. Back then, spot prices for Brent crude, the global benchmark, traded at a $7.50-a-barrel discount to prices six months out.

This is good for all of us who drive cars, by the way. Thanks to contango, refineries pay less for crude oil, which ultimately lowers prices at the pump. That’s part of the reason gasoline prices fell by more than $1 a gallon in 2015 and stayed low for most of last year.

In the past few months, crude prices rebounded from about $30 a barrel and stabilized steady in the mid-$50 range. Contango is almost gone. That Brent crude discount two years ago has shrunk to about $1 a barrel, which has squeezed the profits for physical oil traders. Shell, for example, said that its fourth-quarter trading profit flattened.

Now, the market’s poised to flip—a situation known as backwardation, in which spot prices are higher than futures contracts. Backwardation is the realm of speculators who bet that prices will rise. Rather than buying physical barrels of oil and holding onto it, they pick up spot market contracts that they hope to sell later at a higher price.

Hedge funds already made the biggest bet ever that prices will rise, buying almost one billion barrels in hopes of selling them later for more. Decisions by OPEC and Russia to cut production are driving some of the new market speculation, as is the belief that U.S. President Donald Trump will make good on promises to cut regulation and taxes and spur economic growth.

If OPEC continues to rein in production and the market moves closer to backwardation, look for physical traders to move out of the market and speculators to move in. Increased speculation, though, tends to increase price volatility.

Gasoline prices already have been rising. That trend should continue as contango fades. Unfortunately for consumers, gasoline isn’t like salsa. Even though you know prices are going to rise, you can’t buy up gasoline and store it for later—at least not legally.