The world’s largest agricultural commodity firms are finally making money from trading again.

After years of lackluster returns as bumper crops curbed the volatility traders need to thrive, the stars seem to have aligned for the likes of Archer-Daniels-Midland Co. and Bunge Ltd. China is loading up on American corn and soybeans, profits from oilseeds processing have rebounded, and a drought in Brazil is boosting prices. Even the beleaguered biofuels market is improving.

“There’s really strong demand and a fight for execution, so it’s a better operating environment because of the improved demand outlook,” Paul Maass, chief executive officer of U.S. grain handler Scoular Co., said in an interview. “I think the whole market feels that.”

That’s a stark turnaround for an industry that was stuck with thin margins as farmers increased storage capacity and gained access to more information, relying less on grain handlers at a time when seed development meant big yields year after year. Facing smaller commodity profits, traders diversified into everything from beef to pet food, fish feed and veggie burgers.

Soybean futures have jumped to a four-year high in Chicago and wheat last week touched the highest in almost six years. Corn has rebounded 36% since sinking in April to the lowest level in a decade.

China agreed to buy $36.5 billion in agricultural commodities from the U.S. in 2020 under the phase-one trade deal, up from $24 billion in 2017, the year before the trade war started. The Asian nation has already bought record amounts of corn, and soybean purchases for the current season are running at their strongest pace in data going back to 1991. U.S. exports of pork are at a record and there’s also been rising sales of beef and sorghum.

The sales to China have helped exporters make the most money in years. The elevation margin, or the price difference between crops loaded onto ships at Gulf ports and the cost of a bargeload delivered to New Orleans, hit the highest level since at least 2016 earlier this year, according to Bloomberg calculations using Commodity3 data.

A drought that’s delaying planting in Brazil is also boosting prices, as it could force Chinese buyers to buy even more from the U.S. In the Black Sea region, dry weather has also hurt Ukraine’s corn crop and is threatening wheat plantings in top grower Russia at a time countries are bringing purchases forward and hoarding food.

Traders are also benefiting from tightening currency restrictions in Argentina. With farmers holding back their soybeans as a hedge against an ever-devaluing currency, processing has slowed down in the South American nation. That’s helping crushers in the U.S., which had seen their returns tumble earlier this year as the coronavirus pandemic curbed restaurants’ demand for cooking oil.

Even the biofuels market seems to be turning around. Ethanol margins have turned positive as traffic picks up following the reopening of many U.S. cities and as the expansion of renewable diesel provides a rosier outlook for cooking oils. Soybean oil demand created by renewable diesel will far outstrip supply, with at least an additional 8 billion pounds of the commodity needed by 2023, according to Ken Zaslow, an analyst at BMO Capital Markets.

Investors should start to get a taste of trading profits when ADM, Bunge and smaller rival Andersons Inc. report earnings this week and next. Accelerated Chinese purchases and a rebound in crush margins should translate into solid third-quarter results and confidence in even stronger profits for the following three-month period, said Thomas Simonitsch, an analyst at JPMorgan Chase Co.

While the trading environment has gotten better, the transformation of the Bunge and ADM will also be closely watched, with the former expected to benefit from shedding businesses like sugar and concentrating on oilseeds, and the latter buoyed by the nutrition unit.

“There’s no competitive advantage to be the middleman anymore,” said Seth Goldstein, an analyst at Morningstar Inc. in Chicago. “Farmers have the same information and ADM no longer has the advantage of benefiting from big dislocations in the market. These are long-term structural headwinds that aren’t going to change any time soon.”

“Prior to China phase-one deal coming in stronger, you were kind of lugging through pretty strong balance sheets, pretty strong carryovers, you were lugging excess supplies through the market and that’s just a harder operating environment for everybody,” Scoular’s Maass said.