RUDI DORNBUSCH, a renowned economist who died in 2002, said there were two sorts of currency crisis. The pre-1990s kind is slow. It starts with an overvalued exchange rate, which gives rise to a trade deficit. Foreign-exchange reserves are gradually run down to pay for it. When they are gone, the game is up. The currency drops. The finance minister loses his job. But life goes on much as before. The world does not collapse.

The second sort of crisis is the first sort on steroids. A country that might once have blown some World Bank loans on bad policies is able to tap global capital markets for billions of dollars to misuse. Domestic banks join the party. The economy booms. When the flow of capital suddenly reverses, the currency collapses. Bankruptcy is widespread. The damage is big enough to affect others.

Brazil would seem to demand a third category. Elections this month will decide its next president and the character of its congress. They will thus shape the response to a slow-motion financial crisis. The drama is likely to be played out in the currency market. The impact might be far-reaching. But Brazil shows no signs of an old-fashioned balance-of-payments crisis. It at not at the mercy of global capital. Its crisis is, in essence, a battle with itself.

Compare Brazil with Argentina and Turkey, both in the eye of market storms this year. They fit the template for a currency crisis. Both had run large deficits on the current account, a broad measure of the trade balance. These were financed by foreign borrowing, much of it in dollars. Both suffer high inflation. Both had skimpy foreign-exchange reserves. Brazil is different. Its current account is broadly in balance. Inflation is close to a record low. Its plentiful currency reserves dwarf its dollar debts.

Brazil’s problem is that its government finances are on a dangerous path. Public debt has risen from 60% to 84% of GDP in just four years. That owes a lot to a collapse in revenues after 2013. A brutal recession did not help. But the budget had been flattered by windfall receipts from a mining boom and credit-fuelled consumer spending. Those will not be repeated.

The third way

That means spending cuts are needed to fix the public finances. The government wage bill has grown rapidly. But over-generous pensions are a far bigger problem. They already account for 55% of non-interest public spending. The cost will go on rising as Brazil ages. Things would surely be worse were it not for a constitutional amendment in 2016, which caps the rise in public spending. An attempt to reform pensions was aborted when the president, Michel Temer, was implicated in the corruption scandals that have seen one of his predecessors impeached and another sent to jail.