THE Syrian consulate in Istanbul’s elegant Nisantasi quarter is a busy spot. Men huddle outside in the cold, waiting for their turn to slip through the building’s ornate doors. The rest of the neighbourhood is, however, unusually subdued. A string of terrorist attacks in the city and an attempted coup in July, followed by a purge of suspected sympathisers, has dampened spirits. “After a bomb goes off, no one goes out. A week is lost,” says one shopkeeper.

Besides war next door and terror at home, Turkey’s economy has been rocked by political upheaval farther afield: the lira has plummeted by over 15% against the dollar since America’s election on November 8th. Many tenants cannot now afford Nisantasi’s rents, often priced in foreign currency. Even the childhood home of Orhan Pamuk, Turkey’s best-known novelist (pictured), has a “for rent” sign on the door.

Back in November, Turkey had a lot of company in its economic misery. Other emerging markets also reacted badly to America’s election result, prompting talk of a “Trump tantrum” to match the “taper tantrum” after May 2013, when America’s Federal Reserve began musing about reducing its pace of asset purchases.

In recent weeks, however, the fortunes of emerging markets have parted ways. South Africa’s rand has recouped most of its post-election losses against the dollar. India’s and Indonesia’s currencies are both within 2% of their pre-Trump parities. Brazil’s real, which weakened by 8% against the greenback in the first few days after the election, is now stronger than it was before it. Only Mexico’s peso, still down by about 10%, has rivalled the lira’s decline.

The markets may have concluded that Mr Trump’s policies, intended to put America first, will set some emerging economies further back than others. Consider four potential dangers: a stronger dollar; trade wars; immigration curbs; and a tax holiday that prompts American firms to repatriate foreign profits. Russia is greatly vulnerable to none of these risks, according to Nomura, a bank. Mexico is highly exposed to all of them. Other economies fall somewhere between the two (see table).

What about Turkey? At first glance, it would seem to have little to fear. It is not highly vulnerable to a trade war, the repatriation of profits or curbs on migrant workers. After a fiscal and financial crisis in 2001, Turkey has also repaired its public finances, reformed the banking system, tamed inflation and floated the lira.

But although Turkey has learnt a lot from its past, it has learnt rather less from its peers. The experience of other emerging economies over the past 20 years shows that current-account deficits can be as treacherous as fiscal deficits. It also shows that financing such a gap with long-term foreign direct investment is better than relying on “hot money”. The record also suggests that if the money has to be hot, it is better that it take the form of equity, rather than debt. And if it has to be debt, better that it is denominated in the country’s own currency, not someone else’s.

For all its strengths, Turkey has not abided by these rules of thumb. Its persistent current-account deficit (estimated to exceed 4% of GDP in 2016) has left it with short-term external debt amounting to over $100bn at the end of November (84% of which is denominated in foreign currencies). That is roughly equal to its entire stock of foreign-currency reserves (worth less than $98bn at the end of November). Mexico’s reserves, in contrast, are roughly twice its short-term external debt, according to the IMF.

These external debts and deficits leave Turkey vulnerable to the withdrawal of foreign capital. To prevent it may require higher interest rates, but the central bank has so far tightened only tentatively. Instead of simply raising its “benchmark” rate—the one-week repo rate—it has stopped offering repo auctions altogether. That has forced banks to borrow at its higher overnight lending rate (which it raised by 0.75 percentage points on January 24th) or the even higher rates offered at its “late” liquidity window.

To some economists, the lack of simplicity in the central bank’s policy suggests a lack of conviction. They worry that, despite its statutory independence, it is reluctant to antagonise Turkey’s increasingly powerful president, Recep Tayyip Erdogan, who has fulminated against the “interest-rate lobby” and demanded lower borrowing costs. Mr Erdogan would rather defend the currency by drawing on Turkey’s deep reserves of patriotism, urging Turks to convert their dollars into lira “if you love this country”. One barber told a local television station he would offer a free cut to anyone who converted $300.

If neither central bankers nor barbers stop the lira’s fall, it may be Turkey’s creditors in line for a haircut. On January 27th Fitch, a ratings agency, cut Turkey’s foreign-currency credit rating to junk, citing the country’s exposure to foreign debt and the erosion of checks and balances on its president. The agency thinks more loans (especially to tourism and energy companies) may require restructuring, but it believes Turkey’s banks have enough capital to withstand “moderate shocks”.