Stocks posted sharp gains on Wednesday as recently surging commodity prices cooled off while the war in Ukraine continues.

The Dow Jones Industrial Average rose 620 points, or about 1.9%. The S&P 500 climbed about 2% and the technology-focused Nasdaq Composite gained 2.3%.

The bounce came after the market fell for a fourth day on Tuesday, with the S&P 500 and Dow falling deeper into correction territory and the Nasdaq Composite adding to its bear market losses.

The market is reacting to an easing in commodity prices that have spooked stocks lately. Energy and agriculture products in particular have catapulted higher amid the fighting in Ukraine, while some metals also have posted major gains.

West Texas Intermediate crude, the U.S. oil benchmark, was last down 4% to around $118, while Brent crude, the international standard, fell 3.5% to around $123.

Wheat futures also were sharply lower, falling 6.3% to $1,206 a bushel, though palladium continued its march higher, rising 3.8% to $3,082 per ounce. Silver, copper and platinum were all lower on Wednesday.

“The equity market continues to take its cues from changes in commodity prices, namely oil,” said Kathy Bostjancic, chief U.S. economist at Oxford Economics. “Trading will continue to be volatile and rally when prices retreat, but overall the prospect of oil and non-energy prices remaining very high casts a cloud overall the outlook for economic activity and the equity market.”

Certain consumer-related stocks roared back on Wednesday after weakness on fears that higher gas prices would dent consumer spending. Nike rose 6% and Starbucks added 3.8%.

Airlines and cruise lines were also higher on Wednesday. Carnival Corp. is up more than 7% and United Air Lines is 7.2% higher.

Treasury prices fell and yields climbed as investors rotated out of bonds after huddling in fixed income for protection amid the Ukraine war. The benchmark 10-year note rose about 3.7 basis points to 1.91%. A basis point equals 0.01%.

Bank stocks moved higher as yields rose. PNC Financial was up 4% and Wells Fargo rose more than 5%. Goldman Sachs and JPMorgan were 3% higher each.

Energy stocks were lower on Wednesday following a strong session Tuesday after President Joe Biden announced a ban on Russian fossil imports, including oil, in response to the country’s invasion of Ukraine.

Pepsico shares rose more than 1% after the soft drink giant said it will suspend sales in Russia, though it will continue to sell snacks and essentials such as baby formula. Elsewhere, shares of dating service Bumble soared 37% after it reported profit and expected growth that was much better than Wall Street expectations.

The major averages all closed lower Tuesday after a day of whipsaw trading. The Dow gave up a 585-point gain to end the day lower by 184 points, falling deeper into its correction. The S&P 500 slid 0.7%, in correction territory. The Nasdaq Composite lost 0.2%, after entering bear market territory Monday.

It remains to be seen if the Federal Reserve will manage a soft economic landing, but the U.S. should be able to avoid a recession, according to Ross Mayfield, investment strategy analyst at Baird.

“The strength of the U.S. labor market, consumer and aggregate corporate sector should act as the weight to keep us out of recession near-term,” he told CNBC. “Overall, volatility is likely to persist, [there’s a] wide range of outcomes possible in Ukraine, but the fundamentals of the U.S. economy still look decent, especially if the Fed can navigate raising rates without breaking demand.”

This material is provided by