A decade of improvement in emerging market credit ratings is coming to an end as higher borrowing costs and commodity price falls threaten to lay bare many countries' failure to reform during the good times.
Between 2007 and 2012 emerging economies earned almost 200 rating upgrades from the three main agencies, nearly half of them promotions to the top 'investment grade' category.
Given the weight investors still assign to credit ratings, that was a huge driver for much of the $8 trillion or so that has flowed to emerging stock and bond markets since 2004.
But this week has brought confirmation of two things, both with profound implications for the developing world. First, U.S. money-printing won't last for ever and may end in 2014. Second, China's economy is indeed cooling, and fast.
These factors made recent years good ones for emerging markets. Rock-bottom U.S. interest rates and a resurgent China stoked commodity demand, bringing an exports bonanza, fast economic growth and a chance to borrow at record low yields.
Signs of a reversal sparked a worldwide sell-off in emerging markets this week, with over $6 billion fleeing the sector.
That the golden years might be ending was made clear recently when Brazil, one of the main beneficiaries of China's rise and the easy money tide, saw its outlook cut to negative by Standard & Poor's, putting it in line for a downgrade.
Moody's has since warned it might also cut Brazil's rating outlook because of weak growth, rising debt and lack of reform.
Those worries apply to a number of developing countries, says Sebastien Barbe, head of emerging markets strategy at Credit Agricole, who does not expect any significant rises in average emerging market ratings soon.
"We have turned the page," Barbe said. "In the past decade two factors were driving ratings. One was positive - better management, political stability and the rise of the middle class. The other was artificial, coming from excessive spending in developed countries and excessive savings in Asia."
These imbalances added on average 1.5 percentage points a year to emerging markets' growth, he estimates.
"Now that period has ended and it won't come back. EM must change its business model, China has to invest less and consume more, Brazil has to consume less and save more ... All this is going to be very hard to do," Barbe added.
Data reflects the change in ratings momentum. Fitch, for example, upped six emerging sovereigns last year, versus 18 and 13 upgrades respectively in 2011 and 2010. Negative outlooks are now twice as common as positive, a sea change from late 2011.
The picture is similar for S&P, which upgraded 10 emerging ratings in 2012 versus 19 in 2011. So far this year it has raised four emerging market sovereigns while cutting seven.
The Fed and China have crystalised existing worries over slower growth and weaker balance sheets, which as Brazil and Turkey show, can lead to a rise in political risk.
Of the giant BRICS economies, India is in danger of losing its investment grade rating. South Africa also faces a downgrade while China saw its local debt rating cut this year.
Marie Cavanaugh, S&P's managing director for sovereign ratings, said successful reforms in many Latin American and Asian countries had put them on a stronger footing. Some, such as Mexico, are actually now embracing long-delayed reform.
But the backdrop is changing, Cavanaugh warned: "Many emerging markets are dealing with shifts in cross-border capital flows and the challenges of economic rebalancing."
Big changes have occurred in emerging markets since the turn of the century that should mean they are more robust than in the crisis years of the late 1990s. These include the free float of many currencies, healthy public debt ratios, and trillions of dollars in central bank vaults.
J.P. Morgan notes that almost two-thirds of countries included its flagship emerging bond index, the EMBI Global, are now rated investment-grade, compared with just 2 percent when the index was launched in 1993.
Yet, after an initial reform spurt, relatively few countries have used the good times to improve infrastructure, labour markets and tax collection, or reduce reliance on commmodities.
David Hauner, head of EEMEA fixed income strategy at BofA-Merrill Lynch Global Research, says the 30 commodity exporters he tracks enjoyed a quadrupling of terms of trade since 2012.
But widely used indices measuring corruption or ease of business show only a third have adopted any meaningful reform.
"Commodity prices explain a good part of the improvement in these countries' current account and fiscal balances," he said.
As the tide of easy money ebbs, the high-spending growth model will become unfeasible for many. Hauner uses Russia as an example, noting the budget deficit excluding oil now equates to 10 percent of economic output - double its 2007 level.
The average EM current account balance stands at under 1 percent, a third of pre-crisis levels, Morgan Stanley says.
"You have to ask: are interest rates in line with financing needs?" Hauner said. "If they are lower, their policies are not sustainable: they are a gift of (U.S. money printing)."