THE marvellous edifice of modern finance took years to build. The world had a weekend to save it from collapsing. On March 16th America's Federal Reserve, by nature hardly impetuous, rewrote its rule-book by rescuing Bear Stearns, the country's fifth-largest investment bank, and agreeing to lend directly to other brokers. A couple of days later the Fed cut short-term interest rates—again—to 2.25%, marking the fastest loosening of monetary policy in a generation.

It was a Herculean effort, and it staved off the outright catastrophe of a bank failure that had threatened to split Wall Street asunder. Even so, this week's brush with disaster contained two unsettling messages. One is analytical: the world needs new ways of thinking about finance and the risks it entails. The other is a warning: the crisis has opened a new, dangerous chapter. For all its mistakes, modern finance is worth saving—and the job looks as if it is still only half done.

Rescuing Bear Stearns and its kind from their own folly may strike many people as overly charitable. For years Wall Street minted billions without showing much compassion. Yet the Fed put $30 billion of public money at risk for the best reason of all: the public interest. Bear is a counterparty to some $10 trillion of over-the-counter swaps. With the broker's collapse, the fear that these and other contracts would no longer be honoured would have infected the world's derivatives markets. Imagine those doubts raging in all the securities Bear traded and from there spreading across the financial system; then imagine what would happen to the economy in the financial nuclear winter that would follow. Bear Stearns may not have been too big to fail, but it was too entangled.

Gordian conduits

As the first article in our special briefing on the crisis explains, entanglement is a new doctrine in finance ( see article). It began in the 1980s with an historic bull market in shares and bonds, propelled by falling interest rates, new information technology and corporate restructuring. When the boom ran out, shortly after the turn of the century, the finance houses that had grown rich on the back of it set about the search for new profits. Thanks to cheap money, they could take on more debt—which makes investments more profitable and more risky. Thanks to the information technology, they could design myriad complex derivatives, some of them linked to mortgages. By combining debt and derivatives, the banks created a new machine that could originate and distribute prodigious quantities of risk to a baffling array of counterparties.

This system worked; indeed, at its simplest, it still does, spreading risk, promoting economic efficiency and providing cheap capital. (Just like junk bonds, another once-misused financial instrument, many of the new derivatives will be back, for no better reason than that they are useful.) Yet over the past decade this entangled system also plainly fed on itself. As balance sheets grew, you could borrow more against them, buy more assets and admire your good sense as their value rose. By 2007 financial services were making 40% of America's corporate profits—while employing only 5% of its private-sector workers. Meanwhile, financial-sector debt, only a tenth of the size of non-financial-sector debt in 1980, is now half as big.

The financial system, or a big part of it, began to lose touch with its purpose: to write, manage and trade claims on future cashflows for the rest of the economy. It increasingly became a game for fees and speculation, and a favourite move was to beat the regulator. Hence the billions of dollars sheltered off balance sheets in SIVs and conduits. Thanks to what, in hindsight, has proven disastrously lax regulation, banks did not then have to lay aside capital in case something went wrong. Hence, too, the trick of packaging securities as AAA—and finding a friendly rating agency to give you the nod.

That game is now up. You can think of lots of ways to describe the pain—debt is unwinding, investors are writing down assets, liquidity is short. But the simplest is that counterparties no longer trust each other. Walter Bagehot, an authority on bank runs, once wrote: “Every banker knows that if he has to prove that he is worthy of credit, however good may be his arguments, in fact his credit is gone.” In our own entangled era, his axiom stretches to the whole market.

A question of priorities

This mistrust is enormously corrosive. The huge damage it could do to the world economy dictates what must now be done first. No doubt, there are many ways in which financial regulation needs to be fixed; but that is for later. The priority for policymakers is to shore up the financial system. That should certainly be done as cheaply as possible (after all, the cash comes from the public purse); and it should avoid as far as possible creating moral hazard—owners and employees should bear the costs of their mistakes. But these caveats, however galling, should not get in the way of that priority.

To its credit, the Fed has accepted that the new finance calls for new types of intervention. That is the importance of its decision on March 16th to lend money directly to cash-strapped investment banks and brokers and to accept a broader array of collateral, including mortgage-backed and other investment-grade securities. If investment banks can overcome the stigma of petitioning the central bank, this will guard them against the sort of run that saw Bear rejected by lenders in the short-term markets. Henceforth, the brokers will be able to raise cash from the Fed. The Fed is now lender-of-last-resort not just to commercial banks but to big investment banks as well (a concession that will surely in time demand tighter regulation).

Even if that solves Wall Street's immediate worries over liquidity, it still leaves the danger that recession will lead to such big losses that banks are forced into insolvency. This depends on everything from mortgages to credit-card debt. These, in turn, depend on the American economy's likely path, the depth to which house prices decline and the scale of mortgage foreclosures—and none of these things is looking good. Goldman Sachs's latest calculations, which suppose that American house prices will eventually fall by 25% from their peak, suggest that total losses will reach just over $1.1 trillion. At around 8% of GDP that is not to be sniffed at. But it includes losses held by foreigners, and “non-leveraged institutions” such as insurers. Goldman expects eventual post-tax losses for American financial firms to be around $300 billion, just over 2% of GDP, or about 20% of their equity capital.

The rebuilders' dilemma

That suggests a serious problem, but not a catastrophic banking crisis. And with the world awash with savings, banks ought to be able to raise new capital privately and continue lending. Unfortunately, things are not quite so simple. It would not take many homeowners to walk away from their debts for the losses to grow rapidly. Also, bank shareholders may prefer to cut back on lending rather than raise new equity. That would suit them, as equity is expensive and dilutes their stake. But it would not suit the economy, which would be pushed further into recession by sudden cuts in leverage.

By lending money to more banks for longer against worse collateral, the Fed hopes to stem panic and buy time. It wants Wall Street's banks to assess their losses and strengthen their balance sheets without the crippling burden of dysfunctional markets. And it hopes that cheaper money will ease that recapitalisation, inject confidence and cushion the broader economy. But that lingering risk of insolvency means that the state needs to be ready to take yet more action.

One option is to keep on intervening as events unfold. The other is to shock the markets out of their mistrust by using public money to create a floor to the market, either in housing or in asset-backed securities. For the moment, gradualism is the right path: it is cheaper and less prone to moral hazard (ask investors in Bear Stearns). Yet it is not easy to pull off—again, ask Bear Stearns's backers, who could possibly have been saved had the Fed begun lending to brokers sooner. If the crisis drags on and claims more victims, gradualism could yet become more expensive than a more ambitious approach.

Something important happened on Wall Street this week. It was not just the demise of a firm that traded through the Depression. Financiers discovered that they had created a series of risks that the market could not cope with. That is not a reason to condemn the whole system: it is far too useful. It is a sign that the rules need changing. But, first, stop the rot.