Trading house Trafigura Group rode chaotic moves in commodity markets, worsened by Russia’s war on Ukraine, to score record profit.

The privately held commodities merchant earned $2.7 billion in net profit on $170.6 billion in revenue in the six months through March, it said Friday. Profit was 29% higher than in the same period a year earlier, making Trafigura a winner from a stretch of massive volatility in energy and metal prices. Two-thirds of revenue came from trading oil and other forms of energy.

The results are the first look at how the giant oil and commodities trader fared in the first five weeks of upheaval sparked by Russia’s invasion of Ukraine. Buyers in Europe and the U.S. shunned Russian oil while India scooped up barrels on the cheap. Sanctions have since barred most of the business that European traders like Trafigura did with Russia’s biggest crude producer, pushing Moscow to find new ways to export oil.

The disruption sent global oil prices soaring, with Brent crude prices hitting a 14-year high of about $139 a barrel in March. The international benchmark has slipped back but remains 70% higher than a year ago at about $123 a barrel. Diesel and gasoline prices keep rocketing to record highs.

See also: Oil prices could go ‘parabolic,’ putting global economy in ‘critical situation,’ says Trafigura chief

Trafigura, based in Singapore and run from Geneva, was at the center of the disturbance. It was the biggest Western exporter of Russian oil before the invasion, having struck up a close partnership with state-aligned producer Rosneft PJSC. The company says it has wound down much of that business since war broke out to comply with sanctions imposed by the European Union and Switzerland.

Many traders expect commodity prices to remain high, disrupting the global economy’s recovery from the pandemic and adding to pressure on consumers and businesses from rapid inflation. Stockpiles of metal and energy are low by historical levels and will struggle to meet a sustained rebound in demand, Trafigura said in its half-year report.

Traders such as Trafigura generally don’t bet on the direction of markets. Instead they use sprawling logistical and financial operations to eke out money from gaps in prices between regions, or at different times.

Trafigura has the logistical heft and balance sheet to profit more than most. It handles more than seven in every 100 barrels of oil consumed globally, along with massive volumes of metal, coal, natural gas and other commodities. The company has interests in mining, logistics and industrial-metal operations, and owns a hedge fund. Trafigura is owned by its partners, but bonds issued to finance its sprawling business trade publicly.

The volatility brought challenges. Trafigura, like other traders, relies on borrowed money to finance the commodities its ships around the world. Excluding an African oil subsidiary, Trafigura had $73 billion in credit lines by the end of March from 140 banks, of which $7 billion had been raised over the previous six months.

An outstanding question is the fate of an Arctic oil project into which Trafigura sank 1.5 billion euros, or $1.59 billion, of its own money along with 5.5 billion euros borrowed from a group of banks. The company has frozen its 10% shareholding in Rosneft’s Vostok Oil project and says it intends to sell out. It is likely to incur a loss.

An expanded version of this story appears on WSJ.com.