Until now, international investors have been happy to finance the deficit. Not only were they attracted by the strong economic growth, but they also liked Mr. Erdogan’s pro-market approach, the political stability they thought he had brought and the prospect that Turkey’s march toward a market democracy would be anchored by negotiations to join the European Union, said Timothy Ash, Standard Bank’s head of emerging markets research.

The “interest rate lobby” also liked the fact that the government’s debt was at 35 percent of G.D.P. and that banks had strong balance sheets, partly because they had been seared by the Turkish financial crisis at the start of the millennium. Meanwhile, the rating agencies Moody’s and Fitch recently raised the country to investment grade.

The problem is that the unrest is casting doubt on some of these positive factors. For a start, Turkey no longer looks so stable politically. Then there is the doubt being sown by Mr. Erdogan’s attack on speculators about the depth of his commitment to markets. Furthermore, the crackdown on protestors may undermine Turkey’s chances of joining the E.U. Last week, Germany suggested delaying the next round of negotiations.

The unrest could harm growth if tourists are deterred from visiting and Turkish consumers become more cautious.

A particular weakness is that the current account deficit has been largely paid for with so-called hot money: foreign investment chasing short-term returns. The share accounted for by foreign direct investment — long-term money that cannot easily run away — has been falling, according to Morgan Stanley. Meanwhile, the share made up by debt has been on the rise.

One measure of Turkey’s vulnerability to a loss of confidence is that it has an “external financing requirement” of $205 billion — about a quarter of its G.D.P. — over the next year, according to Standard Bank. This financing requirement is the sum of its current account deficit and the maturing debt it needs to repay or roll over. A more extreme measure of vulnerability would add the $140 billion of foreign-held bonds and shares. If this tries to flee, the lira could plunge.

Against this, the central bank has $130 billion worth of reserves, into which it dipped last week when it helped to stabilize the foreign exchange market. This war chest, though, is small compared with Turkey’s external financing needs. And the net reserves, after excluding foreign exchange deposited by the banking system, are $46 billion, according to Standard Bank.