BANKS have endured a brutal nine months since credit markets froze in August. Losses and write-downs already total $335 billion; many of their best businesses have disappeared. In developed economies, almost all banks are facing economic and regulatory headwinds that will cut revenues and jobs. Yet the biggest danger facing Western finance is not a fall in its earning power but a loss of faith in how it works.

Two criticisms assail the industry, one based on fairness and the other on efficiency. The first argues that finance is rigged to enrich bankers, rather than their customers, shareholders or the economy at large. Some worry about the way bonuses are calculated; others about moral hazard. Bankers will take wild bets because they know they will be bailed out by the taxpayer. Look at Bear Stearns or Northern Rock.

The second, deeper question is whether a market-based approach to finance is efficient. Some Chinese officials claim the Western system has been shown up by the crisis ( see article). This week Germany's president demanded that the “monster” of financial markets “be put back in its place”: bankers had caused a “massive destruction of assets”. The critics do not lack ammunition. The lapses in credit-underwriting in the subprime-mortgage market hardly reflect a wise allocation of capital. The opacity of the shadow banking system and the mind-boggling complexity of those toxic asset-backed products have raised doubts about the discipline of the market.

Forever blowing bubbles

Be careful. It is not just that a rush to regulate is seldom wise: witness Sarbanes-Oxley, the governance act hurried through in the wake of the corporate scandals earlier this decade. The current assault is dangerous because it mixes a number of small truths with a big, alluring myth. The fiddly verities concern the ways in which finance can indeed be made a bit more efficient or fairer. But you can make those changes only if you dismiss the myth: that finance can somehow be stripped of its failures and perfected. Bubbles, excess and calamity are part of the package of Western finance. And still it is worth it.

Some change is desirable and inevitable. Most of it will be supplied, belatedly, by the market itself—especially if it is bathed in the cleansing sunlight of transparency. America's mortgage business is already transformed. Hundreds of unregulated lenders have disappeared, as has the fatally lazy assumption that house prices do not fall. Demand for complex securitised products has shrivelled and the most complex may never come back. The safest forecast in banking is that the next crisis will not be rooted in America's mortgage market.

Regulators also have lessons to learn. Most of them come in two categories. The first is to take a broader view of risk. That means looking at off-balance-sheet assets and at gross exposures (Jérôme Kerviel, accused of losing Société Générale $7.2 billion, went unnoticed because managers were watching only his net positions). For national supervisors, it requires a lead regulator with a remit to watch the system. Internationally, the global capital markets would ideally have global regulatory norms—or at least more co-operation between national authorities. Now that the investment banks know the central banks will stand behind them, they also need closer scrutiny and higher capital standards. For the moment supervisors need monitor only what banks lend hedge funds, but you could imagine some hedge funds becoming so central to the system that they too need direct attention.

The second change in philosophy is to bully banks to build buffers when times are good so they have stronger defences when times are bad. The system has come to amplify the extremes of the cycle. Fair-value accounting, which pegs assets to current market prices rather than their historic value, leads to downward (and upward) spirals in asset prices, and hence leverage. Banks' risk models have been backward-looking, so no time appeared safer than the moment before the bubble burst. Working out when an asset boom has become a bubble is not easy—just as it is hard to use monetary policy to lean against asset-price bubbles. But rapid growth, whether in asset prices or market share, should be a signal to worry, not relax. And if banks are to be subject to the firmer discipline of fair-value accounting, it makes sense to have extra padding.

These changes would certainly come at a cost—which is one reason to weigh them more carefully than the framers of Sarbanes-Oxley did. They would have the effect of increasing the amount of capital and liquidity that banks set aside when risks are building, and reducing the amount of leverage they can take on. That would reduce the size and capacity of the industry, although not the size of individual institutions: one result of the crisis is that universal banks are likely to become even more hulking as they seek the benefits of diversification.

On balance, these costs are worth paying to make finance a little safer. Other reforms don't pass that test. For instance, limiting pay or forcing bankers to take equity stakes in their business will not stop moral hazard: Bear Stearns had high levels of employee share-ownership and it did not know it would be able to call on the Federal Reserve. Indeed, whatever you do, finance will not be “fixed” in the way critics are demanding.

Rome or the barbarians: your choice

As this week's special report on international banking makes clear, the main structural causes of trouble—the collective misjudgment of risk; a zealous search for yield; and the failure of oversight—are deep-seated. In financial history they crop up time after time. Financiers are rightly rewarded for taking risks, which by their nature cannot be entirely managed away or anticipated. The tendency for success to breed complacency and recklessness is as ingrained in financial markets as it is in any other walk of life. However bankers are paid, they cannot just sit out a credit boom; they have to keep dancing. Regulators lack the knowledge, the clout (and often the talent) to keep up with the banks' next brilliant scheme.

That reads like an indictment, until you consider the alternatives. Western finance, to paraphrase Churchill, is the worst way to allocate capital, except for all those other forms. It is obviously better than the waste and dysfunction in China, where centrally planned capital is dished out to the well-connected. But it is also better than the financial system the West used to have. Thanks to the astonishing innovation of the past few decades, derivatives can help firms and investors to hedge risks (there are plenty of Chinese manufacturers who would be grateful for an easy way to soften the impact of exchange-rate shifts). Securitisation widens access to capital for borrowers and to assets for investors: it can finance everything from water utilities to film studios. Leverage brings more lazy companies within reach of determined investors and more homes within reach of poorer consumers.

It is true that financiers have enjoyed vast profits—and the vast salaries that go along with them (pay at American investment banks has been nearly ten times the national average). But the collapse of the credit bubble will bring that down. And despite all the disasters, there are signs of finance's resilience. In the past few months the banks have commanded enough confidence to raise $200 billion in new capital from investors. Bear Stearns and Northern Rock were calamities, but rare ones, because the vast overall losses were spread far and wide. This time, there has been no industry-wide government recapitalisation. After 20 years of growth, the flaws of modern finance are painfully clear. Do not forget its strengths.