FIFTEEN years ago this month, Thailand at last allowed its currency, the baht, to fall against the dollar, abandoning a long, losing battle with market forces. "I haven't slept for two months," said the governor of the central bank on the day of the devaluation. I think that tonight I'll be able to sleep at last. What followed was a five-year nightmare for emerging markets, as the financial crisis spread to Thailand's neighbours, then to Russia and Brazil, before eventually claiming Argentina and Uruguay in July 2002. After the tossing and turning of 1997-2002, the next decade went like a dream. In 2003 China resumed double-digit growth; India's economy expanded by 8%, a feat it would surpass in four of the next six years; Brazil's new president, Luiz Inácio Lula da Silva, appeased the IMF and the bond markets by cutting public debt and achieving the first of five annual current-account surpluses. Goldman Sachs released the first of its 2050 projections ("Dreaming with the BRICs," its catchy acronym for Brazil, Russia, India and China), suggesting that the big emerging economies would eventually inherit the Earth. The crisis-hit countries emerged from devaluation, default and distress with low expectations, cheap and flexible currencies, scope to borrow and room to grow. Global capital markets welcomed them back, buying their equities and their bonds, even when denominated in their own currencies. The popular emerging-markets stockmarket index compiled by MSCI rose by over 350% from the end of 2002 to its peak in October 2007. Rather than spend these capital inflows, emerging economies recycled them. They amassed foreign-exchange reserves as a guarantee against ever again succumbing to a currency crisis or the ministrations of the IMF. Some have even begun to help fund the fight against crises elsewhere. On July 10th Indonesia's central bank confirmed it would buy $1 billion of the IMF's notes, a poignant reversal of roles. But after a dream decade, something is amiss. China is now struggling to grow as fast as 8% (its GDP expanded by 7.6% in the year to the second quarter). India, a country that once aspired to double-digit growth, can now only dream of ridding itself of double-digit inflation. None of the biggest emerging economies stands on the edge of a dramatic financial precipice, like their counterparts in the euro area, or a fiscal cliff, like America's. But their economic prospects have nonetheless started to head downhill. The MSCI emerging-market index is flat for the year and still 30% below its 2007 peak. Only 15 months ago, the IMF's forecasters expected Brazil's economy to grow by over 4% this year. This week their 2012 forecast was just 2.5% (see chart 1). Over the same period, South Africa's 2012 growth forecast was cut from 3.8% to 2.6%. Some of this slowdown can be blamed on events elsewhere. Europe's pain, for example, has spread far beyond its immediate neighbours. The European Union remains the biggest foreign market for many emerging economies, buying about 19% of China's exports and 22% of South Africa's. Euro-area banks have also begun to sell assets and withdraw lending. They account for about 45% of credit to emerging Europe and a substantial share of trade credit in Asia. Some of the slowdown was also orchestrated by governments nervous about price pressures or property bubbles. Poland's central bank raised rates as recently as May to quell inflation, which persists above its 2.5% target. China's premier, Wen Jiabao, fell into a game of chicken with the country's 50,000 property developers, waiting for them to cut prices, even as they waited for him to lift restrictions on multiple home purchases. As growth slows, policymakers will ease in response. But there is more to this story. The slowdown is not simply a demand-side phenomenon, the result of weak exports and past tightening dragging growth below its long-run potential. The underlying rate of sustainable growth may also be less impressive than previously thought. As the IMF pointed out this week, the last decade or so may have "generated overly optimistic expectations about potential growth." High commodity prices boosted some emerging economies, such as Brazil, Russia and South Africa. They also flattered emerging-market share prices. As Bank of America Merrill Lynch observes, natural-resource industries account for more than a third of the market capitalisation of the BRICs and over a quarter of the market cap of MSCI's benchmark index. The dream decade was also sweetened by rapid credit growth, according to the fund. The ratio of bank credit to GDP has risen steeply in many emerging economies (see chart 2) over the past ten years. From trough to peak, it rose by over 20 percentage points in Brazil, China, the Czech Republic, Hungary, Malaysia, Poland, South Korea, Taiwan and Turkey. It rose almost as far in India and Russia. In some emerging economies, the upswing began late in the decade. In China, the credit ratio has risen by over 27 points since 2008 alone. In others, it has already ended: in South Africa, Hungary and South Korea, the credit ratio has fallen substantially since the financial crisis. A rising credit ratio may represent healthy "financial deepening" as the banking system does a better job of capturing household saving and reallocating it to its best use. But it may also reflect a potentially destabilising "financial cycle," an upswing in credit and other financial variables, which overlays and often outlasts the swings in GDP and inflation that mark conventional business cycles. The upturn in the financial cycle may flatter growth, as easy credit encourages spending and speculation, boosting the value of collateral and thus easing credit further. This may have lulled emerging economies into thinking they could grow faster than they really can, just as permissive finance helped persuade the rich world that its growth was more stable than was actually the case. Ninety-nine cred balloons When credit booms show up in inflation, central banks are typically quick to react. But consumer prices often remain tame, because rising exchange rates and imports fill the gap between expanding domestic demand and supply. That allows the booms to grow dangerously large. Selim Elekdag and Yiqun Wu of the IMF have identified 99 "credit balloons," episodes of fast credit growth over the past 50 years in rich and emerging economies alike. Of these balloons, 44 popped badly (resulting in a banking crisis, currency crisis or both) and another 13 very badly, with a 9% contraction of GDP on average. In Asia's emerging economies, credit ratios have risen further and faster than they did before the Thai crisis, says Frederic Neumann of HSBC. Even so, the region's central bankers need not lose too much sleep. Now, unlike then, bank loans have not outstripped deposits. And in most countries, domestic investment has not outstripped domestic saving. If foreign capital were to withdraw abruptly as it did 15 years ago, the effects would not be as ruinous. Most foreign-capital inflows come in the form not of debt but equity, which shrinks to fit an economy's ability to pay. The debt of Asian economies is also now partly in their own currency, which would fall in a crisis, taking some of the strain. If foreign capital retreats, Asia's surplus countries should have enough resources to replace it, although the switch may not be entirely smooth. The picture is different in Europe. In Poland, for example, credit to the private sector grew by an extraordinary 36.6% in 2008, contributing to a current-account deficit of almost 9% of GDP. The crisis interrupted these excesses but did not reverse them: the country's external deficit remains over 5% of GDP. In recent months, the FDI and portfolio capital Poland requires to fill this gap has flowed in the wrong direction. That leaves the country uncomfortably "susceptible" to the euro crisis, says Raffaella Tenconi of Bank of America Merrill Lynch, if it prompts a further withdrawal of cross-border lending. If the credit cycle has got out of hand, who is to blame? Policymakers in emerging economies sometimes present themselves as powerless victims of vague global forces, such as the "tide of liquidity" supposedly sweeping across the globe, thanks to near-zero interest rates in America, Japan and the euro area. But research by Mr Elekdag and Fei Han, also of the IMF, suggests that such external factors explain only a small portion (16%) of the variation in credit growth in emerging Asia. By imposing curbs on domestic credit and allowing greater flexibility in their currencies, economies can regain greater control. As the financial cycle ebbs and emerging economies slow, must they forget the "dream" of an "emerging century," as Jonathan Anderson, formerly of UBS, has put it? Not yet. By 2010, the combined dollar GDP of the BRICs was already about 75% bigger than Goldman Sachs foresaw when it made its original projections seven years earlier. There is therefore a substantial margin for error. The big emerging economies may never again grow as fast as they did after 2003. But the BRICs scenarios did not assume they all would. In its latest projections, released last year, Goldman Sachs envisioned average growth for the rest of this decade of 5.2% in Brazil, 5.4% in Russia, 6.3% in India and 6.9% in China. It now looks as if Brazil and Russia may fall short of this projection. But China and India can still dream of fulfilling it.