Oil rose for the second time in nine days after trading below $45 a barrel for a second day. Gasoline gained more than crude, widening refinery profit margins.

West Texas Intermediate futures erased earlier gains as the dollar strengthened before rallying to settle with an 18-cent gain. The gasoline crack spread, a measure of the profit from processing a barrel of oil into the fuel, advanced to above $9 a barrel after sinking to $6.54 in intraday trading Tuesday.

Oil failed to sustain a gain above $50 a barrel earlier this month amid signs the market surplus will persist. U.S. inventories remain more than 100 million barrels above the five-year seasonal average as the country’s refinery utilization rate hovers near the lowest since January. The Organization of Petroleum Exporting Countries continues to pump above its quota while Iran prepares to ramp up output once sanctions end.

WTI for December delivery gained 18 cents to settle at $45.38 a barrel on the New York Mercantile Exchange. The volume of all futures traded was 27 percent below the 100-day average.

Brent for December settlement increased 23 cents to $48.08 at 2:42 p.m. New York time on the London-based ICE Futures Europe exchange. The European benchmark traded at a premium of $2.70 to WTI.

Source: Bloomberg