OIL PRICES have perked up a bit, but producers are still reeling from the slump in crude prices last year. The boss of Pemex, Mexico’s state-owned oil firm, said this week that the company faced a “liquidity crunch”. Malaysia’s state oil firm is laying off workers. Petrobras, Brazil’s troubled oil giant, recently secured a $10 billion loan from the China Development Bank to help it to pay off maturing bonds. The trouble at these firms underlines broader concerns about the burden of corporate debt in emerging markets. A particular worry for resources firms is the rising cost of servicing dollar debts taken out when the greenback was much weaker than it is now. Short-term dollar loans to be repaid with earnings in falling currencies featured prominently in past emerging-market crises. But the concern about the role of dollar lending in the current cycle is different.

The numbers are startling. Corporate debt in 12 biggish emerging markets rose from around 60% of GDP in 2008 to more than 100% in 2015, according to the Bank for International Settlements (BIS).

Places that experience a rapid run-up in debt often subsequently endure a sharp slowdown in GDP.

An extra twist is that big emerging-market firms were for a while able to borrow freely in dollars. By the middle of last year, the stock of dollar loans to non-bank borrowers in emerging markets, including companies and government, had reached $3.3 trillion. Indeed until recently, dollar credit to borrowers outside America was growing much more quickly than to borrowers within it. The fastest increase of all was in corporate bonds issued by emerging-market firms.

Jaime Caruana, the head of the BIS, argues that a global liquidity cycle—the waxing and waning of dollar borrowing outside America—helps to explain the slowdown in emerging-market economies, the rise in the dollar’s value, and the sudden oil glut. When the dollar was weak and global liquidity was ample thanks to the purchase of Treasuries by the Federal Reserve (so-called “quantitative easing”, or QE), companies outside America were happy to borrow in dollars, because that was cheaper than borrowing in local currency. Capital inflows pushed up local asset prices, including currencies, making dollar debt seem even more affordable.

As long as the dollar remained weak, the feedback loop of cheap credit, rising asset prices and strong GDP growth could continue. But when the dollar started to strengthen, the loop reversed. The dollar’s ascent is tied to a change in America’s monetary policy which began in May 2013, when the Fed first hinted that it would phase out QE. When the Fed’s bond-buying ended in October 2014, it paved the way for an interest-rate increase 14 months later. The tightening of monetary policy in America has reduced the appetite for financial risk-taking beyond its shores.

The impact of this minor shift on the value of the dollar has been remarkable, particularly against emerging-market currencies (see chart 1). Wherever there has been lots of borrowing in foreign currency, the exchange rate becomes a financial amplifier, notes Mr Caruana. As companies scramble to pay down their dollar debts, asset prices in emerging markets fall.

Firms cut back on investment and shed employees. GDP falters. This drives emerging-market currencies down even further in a vicious cycle that mirrors the virtuous cycle during the boom. Since much of the credit went to oil firms, the result has been a supply glut, as producers pump crude at full tilt to earn dollars to pay down their debts.

Mr Caruana’s reading of events has dollar borrowing at its centre. Yet the sell-off in emerging-market currencies has more to it. Rich countries that export raw materials, including Australia, Canada and Norway, have also seen their currencies plummet against the dollar. Falling export income as a consequence of much lower oil and commodity prices is likely to have played a similar role in the slump in other currencies.

Some analysts think the problem of dollar debt is blown out of proportion. There are countries, such as Chile and Turkey, where dollar debts loom large (see chart 2). But the average dollar share of corporate debt in emerging markets is just 10%. Chinese firms account for more than a quarter of the $3.3 trillion of dollar loans to emerging markets—and since August, when fears surged that the yuan would be devalued, they have been swapping dollar loans into yuan, notes Jan Dehn of Ashmore Group, a fund manager.

Much of the foreign-currency debt taken out by companies elsewhere was long-term: the average maturity of bonds issued last year was more than ten years, for instance. That pushes refinancing, and the associated risk of default, far into the future. In many cases, dollar debt is matched by dollar income—even if, as in the case of oil exporters, it is much diminished by low prices. And there are pots of dollars in emerging-market banks to which indebted companies may have recourse.

In any event, the dollar’s ascent has stalled because of concerns about America’s faltering economy and doubts that the Fed can raise interest rates again. Yet the cycle of dollar lending nevertheless has implications that may not be fully appreciated. A recent study of firm-level finances by Valentino Bruno and Hyun Song Shin of the BIS found that emerging-market firms with strong cash balances are more likely to issue dollar bonds. That goes against a tenet of corporate finance, that firms only borrow to invest once they have exhausted internal sources of funds. It suggests that financial risk-taking was the motivation for borrowing. On average, 17-22 cents of every dollar borrowed by an emerging-market company ends up as cash on the firm’s balance-sheet. Such liquid funds could go into bank deposits, or be used to buy other firms’ commercial paper or even to lend to them directly.

In other words, the authors say, companies seem to be acting as surrogate financial firms. As a result, dollar borrowing spills over into easier credit conditions in domestic markets.

This is one of the ways the dollar-credit cycle exerts a strong influence over overall lending in emerging markets. The credit cycle took an apparently decisive turn last year. The stock of dollar credit to emerging markets stopped rising in the third quarter, says the BIS, the first stalling since 2009. Dollar credit is much harder to come by than it was. So are local-currency loans. Bank-lending conditions in emerging markets tightened further in the fourth quarter, according to the Institute for International Finance. The dollar may have peaked but, for emerging markets, tight financial conditions are likely to endure.