AT TIMES last year it looked as if Abdel-Fattah al-Sisi, Egypt’s authoritarian president, was losing his grip. Faced with a faltering economy, he told Egyptians that they needed to sacrifice—by not eating or sleeping, if necessary. Perhaps they could send him their spare change too, he said.

Rummaging behind the cushions hardly seemed enough to turn around an economy plagued by political instability, and by terrorism that had scared off tourists and foreign investors. Moreover, while exhorting his countrymen to tighten their belts, Mr Sisi was squandering billions of dollars of aid from Gulf states on wasteful subsidies and on defending Egypt’s overvalued currency. The futility of these policies can be seen in a handful of figures: a gaping fiscal deficit that hit 12% of GDP last year; ballooning public debt (101% of GDP) and high unemployment (over 12%).

Yet there are signs that Mr Sisi is starting to put Egypt back on a more sensible economic track. In order to obtain a $12bn loan from the IMF last year, his government has raised the price of subsidised fuel and electricity, brought in new taxes and allowed the Egyptian pound to float.

The currency float was promptly followed by a sickening lurch in which it lost 50% of its value. It bounced back sharply in February, then retreated again (see chart). Though the medicine was bitter, it seems to have been just what was needed to lure foreign investors back into the Egyptian market. A sale of $4bn-worth of government bonds in January was more than three times oversubscribed, and foreign purchases of Egyptian treasury notes doubled in the same month. This appetite for investing in Egypt partly reflects a broader demand for emerging-market debt. But it is also a clear sign of growing confidence in the Egyptian economy.

That change in mood is also felt by Egyptians working abroad. Remittances, which accounted for as much as 7% of GDP in 2012, slumped by a fifth last year as people held onto foreign currency rather than send it home to be converted into overvalued pounds. Since the currency has floated, remittances are rising once more.

A weaker currency is also spurring growth, albeit gradual, in trade and tourism. Non-petroleum exports increased by 25% in January compared with the year before. Earnings from exports, along with new loans from the IMF and other sources, are plumping up the country’s foreign-currency reserves. In February they hit their highest level since 2011, promising to ease a shortage of dollars that has hindered Egyptian business. To be sure, businessmen gripe that it is still difficult to get the dollars that they need, and the government is still clearing a backlog of payments to oil firms and other multinationals.

Yet even as exporters celebrate, firms serving the domestic market are struggling. One measure of the health of the domestic economy comes from a purchasing managers’ index (PMI) compiled by Emirates NBD, a bank. Its figures suggest that private, non-oil economic activity has contracted for 17 consecutive months, even though official figures show that the economy as a whole (including oil and the state) has been growing. One reason is that the government’s efforts to cut subsidies mean Egyptians are spending more of their income on fuel and electricity, and have less left over for other things. A weaker currency has also led to higher prices for imports and fuelled consumer inflation. Red tape continues to tie firms in knots, although the government has promised to make it easier to do business, for example by smoothing the process for getting licences and permits to open factories.

The struggles of Juhayna, a big juice and dairy producer, are typical. Its profits declined by 34% in the third quarter of 2016 compared with the same period in 2015. Now it plans to raise prices and cut investment. Seif El Din Thabet, its CEO, blames its troubles on “the recession and low consumer purchasing-power”.

Yet there are signs that a broader recovery may come soon. The weaker currency is proving a fillip to some manufacturers, as consumers switch from expensive imports to cheaper domestic alternatives. Egypt’s trade deficit in January was 44% smaller than it had been a year earlier.

These benefits are yet to trickle down to the average Egyptian. “We hear about the improvement on TV and read about it in the newspapers, but on the ground, nothing is getting better,” says Ashraf Muhammad, a barber in Agouza. Inflation climbed to 28% in January. It will probably remain high if the government cuts subsidies and raises taxes this year, as planned. Prices for staples have skyrocketed; other products are no longer available. “Some medicines I use disappeared for a while,” says Mr Muhammad, who suffers from diabetes. “Now they are available, but at higher prices than before.”

The protesters who toppled Hosni Mubarak, the strongman who ruled Egypt from 1981 to 2011, demanded social justice. So Mr Sisi may be wary of imposing too much pain on Egyptians. His government has backed away from reforms in the past and may lose any sense of urgency when Zohr, a lucrative gasfield, starts production at the end of the year. But international investors and institutions are watching closely for any sign of backtracking. The IMF will review matters before sending Egypt more cash later this year. “We are seeing good progress,” said Christine Lagarde, the head of the fund, last month.

Egyptians are more circumspect. “I don’t blame the government for taking the hard way, but, at the same time, they should have considered the poor people,” says Mr Muhammad. Still, he is sure that things will get better, albeit slowly.