There is a herd psychology at work in the nation's credit markets these days that threatens the already fragile stability of the nation's economy.

It is a manic-depressive behavior that causes wild gyrations in interest rates and gives lie to any claim that there is an aura of professionalism surrounding the buying, selling, lending and borrowing of funds on the loosely knit network commonly called the capital market.

Although President Carter may have to shoulder some of the responsibility for the inflation that was the root couse of the recently diffused interest-rate spiral, he isn't to blame for the erratic money market.

Since last summer the Federal Reserve, the architect of the nation's monetary policy, has moved slowly and steadily to reduce the rate of money growth that is a prime ingredient in inflation. Today the Fed has slowed money growth so much that in recent weeks it has been forced to pump funds into the economy.

That the Federal Reserve kept the clamps on too long as it always does may be due as much to wall Street's persistent refusal to believe that the Fed was acting as it is to the central bank's congenial fear of inflation.

In any event, this year's wild and wide swings in interest rates have guaranteed that the recession will be worse than it had to be. The inability of companies to plan their spending on plant and equipment intelligently because of the alternately moribund and boom behavior of the bond markets well may remove the one spending prop the economy could have expected as it moves from expansion to regression. Corporate investment, which produces more efficient facilities, is also a bulwark against future inflation.

When the recent plunge in interest rates comes to a half, as it must, the erratic psyches on Wall Street well might trigger another interest-rate spiral that could plunge the bond market back to the depths of its February depression.

Look at the record.

In February, many of the leading sages on Wall Street had written off as dead the nation's bond market -- the source of much of the long-term money that businesses need to fund their capital spending projects.

Companies (and municipalities, too) cancelled planned offerings of long-term debt because of a total lack of interest on the part of investors even though bonds then were carrying rates of return as high as 15 percent that would be guaranteed for 25 to 30 years.

Today, however, Lazarus-like, the bond markets miraculously are back to life. Companies are rushing in to sell new bond offerings while the getting is good. Traders who were wringing their hands in February today are writing orders. Big bond buyers who wouldn't touch a long-term debt security two months ago are buying everything they can get their hands on.

Analysts caution that because bond investors must worry about long-range prospects, debt markets always are subject to the expectations of the participants, even though it is difficult to see why expectations should have changed drastically in the past few months.

But in the short-term markets -- where funds are lent for 30 days, not 30 years -- the behavior of the current economy is supposed to be the prime factor.

Short-term interest rates have swung more wildly than long-term rates. Already at record levels by early March, they soared in the weeks after President Carter finally headed Wall Street's insistent demands that he take old/new steps to fight inflation. Today, a few short weeks later, those same short-term rates have plumeted.

So-called money market rates -- such as those paid on big bank certificates of deposit -- have fallen 7 or 8 percentage points since the middle of last month. The bank prime rate has come down more slowly, but still has slipped from its mid-April record of 20 percent to 17 percent.

There's no adequate explanation either for the abrupt decline or for the surge earlier in the year. Admittedly, as the economy moves from expansion to recession, that portion of the inflation rate due to excess demand should decline. In turn, interest rates -- which are the cost of money -- also should decline.

But the evidence of a recession was there in March for all but the most partisan of politicians to see. The president's new anti-inflation program announced March 14 was perceived properly as a belated stab at a problem that already had ended: excessive demand for credit on the part of businesses and consumers.

With the exception of a few banks (as the Hunt brothers' silver saga demonstrated), financial institutions had stopped making loans to underwrite speculation and mergers. The number of corporate mergers dropped 29 percent in the first three months of the year. Individuals had cut back on their borrowing by March 14. The Carter program merely feigned closing a door that by mid-March had closed itself.

But in response to the president's announcement the money markets ran scared and pushed up interest rates with record swiftness. Then, suddenly last month, those same markets pushed rates down with blinding speed.

Why? "I don't know; the bandwagon effect, I guess," said one trader.

"There was some air in there as the rates went up; there's some air in there now, too," said Richard Peterson, cheif economist at Continental Illinois National Bank. Peterson said the rates have fallen too far too fast and must reverse themselves.

Although bank borrowings by businesses have declined sharply in recent weeks, a new route of business borrowing will ensue as the recession both squeezes corporate profits and forces compani-es to finance inventories they cannot sell. That is normal and expected behavior in the early stages of a recession.

But if money market behavior is any guide, the same herd psychology that turned an interest-rate peak into an interest-rate crash last month could transform renewed borrowing by companies into another interest-rate spiral.

That would cause renewed problems for companies seeking to sell long-term debts to finance their capital projects.

As Peter, Paul and Mary might put it, on Wall Street "it's either sadness or euphoria." There will be little the Carter administration can do about that, short of offering money market traders lithium in exchange for the valium they habitually swallow.