The market was 500 trades away from Armageddon on Thursday, traders inside two large custodial banks tell The Post.

Had the Treasury and Fed not quickly stepped into the fray that morning with a quick $105 billion injection of liquidity, the Dow could have collapsed to the 8,300-level – a 22 percent decline! – while the clang of the opening bell was still echoing around the cavernous exchange floor.

According to traders, who spoke on the condition of anonymity, money market funds were inundated with $500 billion in sell orders prior to the opening. The total money-market capitalization was roughly $4 trillion that morning.

The panicked selling was directly linked to the seizing up of the credit markets – including a $52 billion constriction in commercial paper – and the rumors of additional money market funds “breaking the buck,” or dropping below $1 net asset value.

The Fed’s dramatic $105 billion liquidity injection on Thursday (pre-market) was just enough to keep key institutional accounts from following through on the sell orders and starting a stampede of cash that could have brought large tracts of the US economy to a halt.

While many depositors treat money market accounts as fancy savings accounts, they are different. Banks buy a variety of short-term debt, including commercial paper, with the assets. It is an important distinction because banks use the $1.7 trillion commercial-paper market to fund their credit card operations and car finance companies use it to move autos.

Without commercial paper, “factories would have to shut down, people would lose their jobs and there would be an effect on the real economy,” Paul Schott Stevens, of the Investment Company Institute, told the Wall Street Journal.

Cracks started to show in money market accounts late Tuesday when shares in one fund, the Reserve Primary Fund – which touted itself as super safe – fell below the golden $1 a share level. It had purchased what it thought was safe Lehman bonds, never dreaming they could default – which they did 24 hours earlier when the 158-year-old investment bank filed Chapter 11.

By Wednesday, banks sensed a run on their accounts. They started stockpiling cash in anticipation of withdrawals.

Banks, which usually keep an average of $2 billion in excess reserves earmarked for withdrawals, pumped that up to an astounding $90 billion by Wednesday, Lou Crandall, chief economist at Wrighton ICAP, told The Journal.

And for good reason. By the close of business on Wednesday, $144.5 billion – a record – had been withdrawn. How much money was taken out of money market funds the prior week? Roughly $7.1 billion, according to AMG Data Services.

By Thursday, that level, fed by the incredible volume of sell orders pouring in from institutional investors like pension funds and sovereign funds, had grown to $100 billion. It was still not enough to stem the tidal wave.

The banks knew something drastic had to be done. So did Paulson.

The injection of capital into the market was followed up by calls from Treasury Secretary Hank Paulson to major money market players like Bank of New York Mellon and State Street in Boston informing them that federal money was in the market and they should tell their clients the Feds would be back with a plan to stem the constriction in the credit market.

Paulson knew the $105 billion injection was not a real solution. A broader, more radical answer was needed.

Hours after Paulson made his round of calls to calm the industry, word leaked out that an added $1 trillion bailout of banks was being readied. Investors cheered. At about 3 p.m., news of the plans was filtering up and down Wall Street, fueling a 700-point advance in the Dow Jones industrial average through 4 p.m. Friday.

By that time, Paulson had announced the plan. It included insurance on money market accounts, a move that started in quiet Thursday morning, when the former Goldman Sachs executive saved the country from a paralyzing meltdown.

mgray@nypost.com