FOR the second time in as many months, Iran’s “dollar patrol” is on the streets. The country’s currency, the rial, has lost a third of its value on the black market since September. On April 9th it sank to a record low of 61,000 to the dollar (when the official rate was 37,850). The next day the government imposed a rate of 42,000 and vowed to arrest anyone who bought or sold rials for what they are actually worth—as it did during the previous currency crisis, which was only in February.

Some are nonetheless flouting the rules, demanding 56,000 rials or so for a dollar. There were long lines and, surprise, surprise, dollar shortages at the handful of exchanges using the official rate. A lack of confidence in the rial reflects a lack of confidence in the economy. The housing market is stagnant and the banking sector is shaky. Iranians are snapping up foreign currency because it is one of the few sound investments available.

Something similar happened in 2012. Back then Iran was under crippling sanctions and suffered from an annual inflation rate of around 25%. Many Iranians thought those days were over when, in 2015, Iran signed a deal with world powers that imposed restrictions on its nuclear programme in exchange for sanctions relief. President Hassan Rouhani expected to attract large amounts of foreign investment and recoup $50bn in frozen assets, equivalent to 12% of GDP.

Those benefits have not all materialised. The government is quick to blame Donald Trump, the American president, who is threatening to withdraw from the agreement (and may do so next month). The fear of fresh sanctions no doubt dampens investment. So do American sanctions (related to other aspects of Iran’s behaviour) that remain in place and discourage big banks from handling Iranian transactions. In 2016 Iran recorded just $3.3bn in foreign inflows. Israel, with a similar GDP and one-tenth the population, drew $12.3bn. But Iran’s corrupt, opaque economy would probably be struggling even without Mr Trump. Companies linked to the Revolutionary Guards have revenues equivalent to a large share of GDP. Their empire spans construction, mining and telecommunications. A foundation linked to the supreme leader holds $95bn in assets, according to an investigation by Reuters in 2013. Many banks are on the brink of insolvency, in part because of pyramid schemes that swindled millions of poor Iranians. The head of parliament’s economic committee said in April that some $30bn in capital fled the country at the end of last year. From the outside Iran looks ascendant, using proxies to expand its reach across the Middle East. In Syria it is establishing a permanent military presence. In Yemen it dragged arch-rival Saudi Arabia into a ruinous war at little cost to itself. At home, however, the regime looks increasingly brittle. In late December thousands of Iranians unexpectedly took to the streets to vent their frustrations. A subsequent poll by the University of Maryland found that 69% of Iranians think the economy is in bad shape, up from 49% two years earlier. Two-thirds of them blame mismanagement and corruption, rather than sanctions. Nearly half think Iran spends too much money on foreign adventures. The protests stopped after the regime killed or locked up lots of protesters, but it is now battling discontent on other fronts. Dozens of young women have been arrested for doffing their headscarves in public to protest the official dress code. In February there were deadly clashes between the police and Sufis, who have long been harassed by the authorities. After a rare uproar in parliament this winter, Mr Rouhani backtracked on plans to cut subsidies.

Looming over all this is the question of who will succeed Ali Khamenei, the 78-year-old supreme leader who is rumoured to have suffered from prostate cancer. The presumed front-runner, Ebrahim Raisi, embarrassed himself last year when he ran for the presidency—and lost by 19 points. Whoever takes charge will inherit a restive, youthful country that has been mismanaged for decades. The nuclear pact created hopes for change. Unmet expectations may pose a bigger threat to the regime than sanctions ever did.