THE days when subprime mortgages were what kept bankers awake at night are long gone—though thanks only to the barrage of explosions in other corners of finance. In terms of toxicity, however, subprime has had no equal. Until now, perhaps. Even as credit markets, particularly corporate-debt markets, show some signs of improvement, mortgage loans to supposedly better-heeled Americans are souring at a gut-wrenching rate.

Of particular concern are “Alt-A” mortgages, offered to borrowers sandwiched between subprime and prime. This market was trumpeted as a means of extending home ownership to those, such as the self-employed, with a reasonable credit standing but unsteady income. Its practitioners specialised in loans with scant documentation and exotica such as negative-amortisation mortgages, which allow borrowers to pay less than the accrued interest, with the difference added to the loan balance.

That Alt-A has troubles comes as no surprise. Last summer, for instance, it helped to bring down IndyMac, a Californian bank. But the speed with which loans have soured in recent months, and the reaction of rating agencies, have been startling. Delinquencies rocketed in the final months of 2008. They even rose sharply for loans made in 2005, before underwriting turned really sloppy (see chart).

The rating agencies are rushing to catch up with this grim reality. Moody’s, which last summer had issued a sanguine outlook for Alt-A, recently quadrupled its loss projections on bonds backed by such loans. A steady flow of downgrades has turned into a flood in recent weeks, with thousands of Alt-A tranches taking the plunge. The falls have been unusually steep: of the $59 billion of AAA-rated securities that Moody’s cut between January 29th and February 2nd, an astonishing 91% went straight to junk, according to Laurie Goodman of Amherst Securities. In ratings terms, Alt-A is doing worse than subprime.

Moody’s calls this “unprecedented”. That is putting it mildly. It now expects losses for 2006-07 Alt-A securitisations to top 20%, compared with an historical average of well under 1%. In an ugly echo of the fiasco over collateralised-debt obligations, holders lower down the structure can expect total write-offs, while the vast majority of senior holders will not be spared substantial losses.

The sums involved are depressingly large. In the worst case, losses on the $600 billion of securitised Alt-A debt outstanding—roughly the same as the stock of subprime securities—could reach $150 billion, reckons David Watts of CreditSights, a research firm. Analysts at Goldman Sachs put possible write-downs on the $1.3 trillion of total Alt-A debt—including both securitised and unsecuritised loans—at $600 billion, almost as much as expected subprime losses. Add in option ARMs, a particularly virulent type of adjustable-rate loan, many of which are essentially the same as Alt-A, and the potential hit climbs towards $1 trillion.

Part of the problem is that much of the Alt-A lending came at the tail-end of the credit boom in late 2006 and early 2007. By then, subprime was already getting a bad name. So Wall Street hit on a ruse: it took borrowers who in normal times would have been subprime and dressed them up as “mid-prime”. Many of these loans were doomed from the start. According to the Bank for International Settlements, a staggering 40% of American mortgages originated in the first quarter of 2007 were interest-only or negative-amortisation loans.

In theory, interest-rate declines over the past year should offset the “payment shock” felt by borrowers whose loans reset from low teaser rates to higher ones. But house prices have fallen so steeply that perhaps half of all Alt-A borrowers are in negative equity; for many, walking away may seem the best option. Moreover, option-ARM borrowers who had not expected to start repaying principal until 2015 or later may now have to do so as early as this year, because they are hitting triggers that recast the loan early. Government efforts to stem foreclosures should help these unfortunates, though they may do little for owners of mortgage-backed bonds, who could face higher losses as a result of “cramdowns”, in which bankruptcy courts order a reduction in the principal owed.

Alt-AaaaaarghThe pain will be felt across the financial industry. Insurance firms, which gobbled up large but unknown quantities of highly rated Alt-A paper, will now be forced sellers since they are not permitted to hold securities rated below investment grade.

Banks have already sold a sizeable chunk of their Alt-A holdings to hedge funds and other asset-management firms, often at large discounts. UBS’s exposure has fallen from $26.6 billion to just $2.3 billion, for instance. But other European banks were not so zealous. ING, a Dutch bank, still has €27.7 billion ($35.1 billion) of Alt-A debt. American banks are sitting on perhaps $800 billion of the stuff.

As the market prices of mortgage securities have fallen, banks have had to mark down their holdings, taking “unrealised” losses that erode their capital position. Multi-notch downgrades could put further downward pressure on prices. They hit capital in another way, too, because junk-rated debt carries a punitive risk weighting; banks must set aside five times as much capital as they have to for top-notch securities. Rating cuts also affect income statements, by pushing banks to acknowledge that losses which they had classified as temporary are now permanent.

The weakest may now need to raise fresh equity. If they are lucky, banks will be able to palm some of the risk on to governments via asset guarantees or “bad banks” that assume their noxious assets. The Dutch government has agreed to bear the risk on much of ING’s Alt-A holdings, and Citigroup’s $11.4 billion exposure to Alt-A bonds falls under a guarantee that formed part of its November bail-out. It will receive further help from the industry-wide bank-rescue package that the Obama administration is preparing.

What the taxpayer will get in return is far from clear. Officials are still wrestling with how to value beaten-up mortgages. Assessing the worth of Alt-A loans can be especially tricky because they are maddeningly heterogeneous, thanks to a broad assortment of payment options. Less rigorous banks carry some holdings at around 60 cents on the dollar. Morgan Stanley’s are marked at half that. Its shares have rebounded recently, partly on hopes that it will be able to write up these securities once the government unveils its bail-out.

The biggest single Alt-A casualties are America’s bungling mortgage agencies, Fannie Mae and Freddie Mac. They waded into the market in 2006-07, snaffling up business in red-hot states such as California and Arizona, comforted by down-payments of 20%. When house prices there fell by more than that, they were left holding the first loss, since borrowers who put in that much equity do not have to take out mortgage insurance.

Rotten as Alt-A loans are, worse may be to come. As unemployment in America heads towards 8%, even strongly underwritten loans will go bad. Bankers are growing increasingly anxious about the $1.1 trillion of prime mortgage loans and securities, much of which they held on to themselves, assuming it to be bombproof. This sits on their books at “much more optimistic” values than lower-grade mortgages, says one. Some 70% of prime securities will eventually have their ratings cut, according to a “downgrade-o-meter” produced by JPMorgan Chase. As Guy Cecala of Inside Mortgage Finance, a newsletter, puts it: “The mortgage storm’s first wave was subprime. Now we are being buffeted by Alt-A. But a bigger wave is on the horizon, and it cuts across all loan types.”