NEVER has China’s bond market had such a stormy spring. It has already set a record for defaults in the second quarter. The cost of credit for firms has shot up. Even the state-owned companies that invest in infrastructure, previously sacrosanct, are seen as risks. What has gone wrong?

The answer is nothing at all. Defaults are progress for China, which needs to clear a backlog of accumulated debt. This year’s casualties amount to a mere 0.1% of the bond market. But that is still an improvement on the recent past, when investors assumed that the government would rescue any big firm in trouble. The real worry is not that the defaults will go too far, but that officials will lose their nerve.

China needs to deleverage because, over the past decade, total debt has risen from 150% of GDP to nearly 300%. This is a cloud over the global economy: such a rapid increase often predicts financial trouble. Although it is far too early to relax, China has made headway in the past two years in stabilising its debt burden. Partly, that reflects a lucky rise in commodity prices, which has buoyed profits at struggling steel and coal firms. But the stockmarket crash of 2015 and the huge capital outflows in 2016 also persuaded President Xi Jinping that financial frailties were endangering national security and that the country needed a change in policy.

Some government actions have been dramatic, notably the arrests of tycoons who made lavish investments abroad. Others have been bureaucratic, such as a merger of bank and insurance watchdogs in order to improve oversight. The most important, though, has been the start of a clean-up of the financial system. Banks have written off some 5trn yuan ($780bn) of bad loans, raised almost 1trn yuan in fresh capital and are on course to raise another 1trn yuan. That adds up to an infusion about three-quarters the size of America’s bank rescue after the financial crisis. Regulators are also reining in China’s once-booming world of shadow banking. Banks have been ordered to bring off-balance-sheet loans back onto their books (see Finance section). Asset growth in the banking sector fell by nearly half last year.

Safe, not stagnant

Two risks darken this picture. The first is that the government will backtrack. The first bond default in China did not come until 2014 and today’s failures are provoking cries of pain. Banks want an easing of strict new asset-management rules. Fitch, a rating agency, estimates that, if corporate debt stabilises, growth will slow to 4.4% by 2020 from nearly 7% last year. Milder slowdowns have scared the government off the path of prudence before. This time it must hold the line.

The second, less obvious, risk is that China will revert to a stodgily inefficient banking system. Entrepreneurs have flourished over the past decade, thanks in part to easier access to credit. Amid the clean-up, the concern is that banks will again favour state-backed borrowers. Defaults have so far been concentrated in the private sector.

If the government is to create a financial system that is safe without being sclerotic, it needs to change incentives. It should not bail-out state-owned firms (or, if that is too much, those in non-strategic sectors). It should let small, weak banks fail, because national lenders are less beholden to local interests. It should also distinguish between good and bad competition in finance. China is right to throttle undercapitalised shadow banks. But it also needs to allow for technology firms such as Tencent and Ant, Alibaba’s financial affiliate, to compete against banks, so long as all comply with the same regulations. That goes for foreign lenders, too. The task for China is not just to solve the problem of past excesses, but to lay the foundations for future growth.