BACK in July, Nicolás Maduro’s big problem was an opposition-backed rebellion against his plan to replace Venezuela’s elected parliament with a hand-picked constituent assembly. More than 120 people died in mass protests and the armed forces briefly seemed to waver in their support for the government. Now Venezuela’s dictator-president has his new assembly in place and the opposition where he wants it—divided and debilitated. But he has another problem: he is running out of cash.

After years of mismanagement, Venezuela’s all-important oil industry is listing like a shipwrecked tanker. According to data provided by the government to OPEC, oil production in October averaged 1.96m barrels per day (b/d), down 130,000 b/d from September (and 361,000 b/d from October 2016). Subtract oil supplied for almost nothing to Venezuelans and to Cuba, and shipments to repay loans from China and Russia, and only around 750,000 b/d are sold for cash, according to Francisco Monaldi, a Venezuelan energy economist at Rice University in Texas. And although the oil price is up from its low of 2015, it is still a little more than half its level of 2012.

Because the regime’s policies have all but crushed other businesses, oil now accounts for 96% of exports. Despite a brutal squeeze on imports, the government is struggling to service the debts piled up by Hugo Chávez, Mr Maduro’s late predecessor and mentor. In October Standard & Poor’s, a rating agency, declared Venezuela in “selective default”. By October 27th the country was behind on payments totalling $1.5bn, of which more than half was unpaid for more than 30 days.

Latin America has seen plenty of debt defaults, but this one is different. “I decree a refinancing and restructuring of all…Venezuelan payments,” Mr Maduro said. He is fond of issuing decrees; he may be surprised to learn that creditors cannot simply be bossed around. He entrusted negotiations to his vice-president, Tareck El Aissami—a man financiers in New York cannot do business with because the United States says he is a drug trafficker (which he denies). Recent US sanctions also mean that Americans cannot accept new bonds from Venezuela, as a debt restructuring would require.

Some bondholders are now consulting their lawyers, according to Francisco Rodríguez of Torino Capital, a broker. One of their contractual options is to “accelerate” defaulted bonds, requiring their immediate full repayment—and then to seek a court order to seize oil cargoes and other assets. They may hesitate if they think the government will try to carry on paying—some of the delays are because bankers are now subjecting Venezuelan payments to close scrutiny. But “the ball is in the bondholders’ court”, says Mr Rodríguez.

All this means it was a funny time for Mr Maduro to choose to fire his oil minister and the head of the state oil company, PDVSA. The new boss of PDVSA, Manuel Quevedo, is a general of the national guard, the paramilitary police who beat down the protests. His appointment comes after the arrest, allegedly for corruption, of more than 50 oil-industry managers close to Rafael Ramírez, Chávez’s oil supremo, who was himself reportedly sacked as Venezuela’s ambassador to the UN on November 29th. Mr Quevedo knows nothing of oil—but he is close to Diosdado Cabello, a former army officer who is Mr Maduro’s chief rival in the regime. Analysts say Mr Cabello has long wanted to control the oil industry, the main source of money in Venezuela, since money is power.

One prospect glimmers through this murk. Mr Maduro is buoyed by the government’s success in state elections in October. Demoralised opposition voters stayed away, and the regime managed to persuade many poor Venezuelans that if they did not vote for the government they might not receive rations of subsidised food. Fraud may have helped. By jailing uncompromising opponents, Mr Maduro has tamed others. Although part of the opposition is holding talks with the government in the Dominican Republic on December 1st, there is no sign that Mr Maduro will allow the presidential election due by December 2018 to be free or fair.

Rather, the talk in Caracas is that he will bring the vote forward, perhaps to March. Having squared Mr Cabello, Mr Maduro would run again. And he would spend a few billion that might have gone towards debt payments to boost imports temporarily. Stringing along bondholders while intending to default may be a winning political strategy in the short term. And then? “They are clearly expecting the oil price to save them,” says Mr Monaldi. “But it may be too late.”