The federal budget deficit has fallen more sharply over the past year and a half than many people appreciate, and much of the decline is due to a clampdown on spending, not just the one-time surge in revenue from the 1986 tax bill.

Because attention has focused on "gimmickry" built into the budget in recent years -- the sale of government assets, for example -- to seemingly reduce the size of the deficit, a sense of the real improvement that has occurred has been lost. Now, in the wake of the stock market tumble, financial market participants are clamoring for a further big cut in the deficit in the fiscal year that began this month.

Some economists, such as William Niskanen, the former member of the Council of Economic Advisers who heads the Cato Institute, are skeptical that budget developments had much to do with the market's plunge. He noted that between the market's peak in August and the debacle of the past weeks "there was nothing but good news about the budget deficit."

Niskanen pointed out that the Reagan administration estimated in August that the budget deficit for fiscal 1987, which ended Sept. 30, would be $158.4 billion. That actual number, released last week, turned out to be $148 billion. Both figures were well under last January's original estimate of $173.2 billion.

And of course all of those were down sharply from the record $221.1 billion for fiscal 1986.

Some of that $73 billion reduction in the deficit was indeed due to budget gimmickry about which the market's skepticism is justified. However, use of some alternative budget figures taken from the national income and product accounts of the Commerce Department -- these are the accounts from which gross national product, personal income and similar statistics are derived -- paint essentially the same picture. The Commerce Department's budget numbers exclude purely financial transactions such as the sale of government loans and are not affected by such maneuvers as moving a military pay date from one fiscal year to another, another of the ploys used to reduce the 1987 deficit.

According to the Commerce figures, the deficit fell from an annual rate of $217 billion in the second and third quarters of calendar 1986 to a rate of about $140 billion in the comparable quarters this year.

For the full fiscal years, the deficit fell from $211.3 billion to about $160 billion, more than a $50 billion improvement.

Furthermore, not all of the improvement was the result of higher revenue that will not continue, as many market participants and even President Reagan seem to believe.

Between those same middle two quarters of 1986 and 1987, spending rose from a rate of $1,042 billion to $1,063 billion, a 2 percent increase. Meanwhile, the overall economy expanded 5.7 percent. Neither change is adjusted for inflation.

Looked at another way, in the second and third quarters of 1986, federal spending was equal to 24.6 percent of GNP and revenues equal to 19.5 percent -- leaving a deficit of 5.1 percent of GNP. A year later, as the economy grew considerably faster than federal outlays, spending was down to 23.7 percent of GNP and receipts had risen to 20.6 percent.

Thus, over the year, the deficit shrank from 5.1 percent to 3.1 percent of GNP, with the improvement just about equally due to real spending restraint and higher receipts, with little gimmickry left in the figures.

But there is bad news. According to estimates from both the Office of Management and Budget and the Congressional Budget Office, if no new action is taken to cut federal programs or raise additional revenue, the deficit will start to go up again this year -- even if the economy continues to grow at a moderate pace.

For one thing, part of last year's revenue gain was caused by a surge in capital gains taxes as individuals cashed in investments to beat a rise in capital gains tax rates.

For another, part of the decline in the deficit was because the nation enjoyed solid growth and a declining unemployment rate at the same time -- a combination unlikely to recur in the coming year without running the risk of inflation pressures should unemployment fall below 5 percent.

But even before the market went down and triggered the latest negotiations between the administration and Congress over how to reduce the deficit, a revised Gramm-Rudman-Hollings budget act had mandated a $23 billion cut in spending effective Nov. 20. Such a cut, according to the Congressional Budget Office, would just about keep the deficit from going up this year.

Since the current negotiations appeared at week's end to be aiming at a package not much larger, some analysts questioned whether an agreement would make much difference to the market.

At the same time, the analysts questioned whether in the wake of the stock market decline the economy will be strong enough to bear a much larger reduction in the stimulus the budget provides. A related question is why the large drop in the deficit did not squeeze the economy in the past year.

Martin Feldstein, a former Council of Economic Advisers chairman now at Harvard University, said the fiscal contraction of the past year was largely offset by a decision by consumers to increase their spending more rapidly than their incomes rose. For instance, personal saving as a share of disposable personal income fell from 4.5 percent in the middle two quarters of 1986 to 3 percent in the same quarters this year.

Consumer willingness to save a smaller share of their income kept the economy moving -- as did improvements in the industrial sector related to stronger demand for U.S. exports -- while the decline in the budget deficit was tending to restrain economic growth.

Over this same period, particularly in the first half of it, the Federal Reserve also continued to supply enough money to the economy to push down interest rates. More recently, rates have risen, with long-term rates up significantly.

Feldstein believes that $23 billion worth of budget restraint is about all the economy will be able to handle in the coming year. "Looking ahead, if I believed the talk about getting a $50 billion reduction, I would be worried. I do not want to pull back from the Gramm-Rudman target, but I would not want to go much beyond it."

Feldstein and a number of other analysts believe what is critical is not the size of the deficit reduction for fiscal 1988, but whether a credible program can be devised to keep the deficit falling in 1989 and beyond.

Charles L. Schultze of the Brookings Institution, another former CEA chairman, declared, "What's critical is not exactly how big the 1988 part of this is. What is critical is how credible it is."

He said, "The real problem is that the financial markets are looking ahead and seeing a reduced inflow of foreign capital in the next few years." If that happens, and there is no decline in federal borrowing to finance the deficit, interest rates could rise, hurting U.S. domestic investment and possibly setting off a recession.

A rise in American saving would make more funds available in the capital markets, but no one is willing to count on that happening.

Schultze suggests that Congress and the administration ought to aim at reducing the deficit "to well under $100 billion by 1990." If the deficit otherwise would likely be around $170 billion in fiscal 1988, that would mean about a $90 billion cut over three years, including the cut under consideration now.

Achieving that would take a combination of spending cuts and revenue increases of about $75 billion or $80 billion, with the rest made up of savings on interest on the public debt due to the lower deficits in each of the coming years, he said.

"That's the substantive answer, and it is politically difficult," Schultze continued. "But we need a big package that is phased in. Whether it is $25 billion or $30 billion this year doesn't make much difference."

To make promises about future years credible, Schultze believes that Congress should consider some extraordinary step, such as passing two-year appropriations bills. "If you seized on this crisis, you might even include Social Security to make a modest contribution," he said. Both President Reagan and the congressional leadership of both parties have said Social Security benefits will not be affected by deficit cutting.

Schultze concluded, "I don't think anyone is thinking in terms of large enough numbers. Yes, we have to worry about not overdoing it this year. But we have to settle this thing {the stock market} down. We are going to have a lower dollar, and we could have it with soaring interest rates or we could have reasonable interest rates."

At around 3 percent of GNP, the federal budget deficit is down to a level -- relative to the size of the economy -- the nation last saw in late 1981, when the last recession was getting under way.

The big drop in the deficit recently was not enough to reassure financial markets because it came when foreign investors had become much less willing to put their money in the United States. The bulk of the foreign money flowing in this year has come from foreign central banks that were acquiring dollars to keep the currency's value from falling compared with their own currencies.

Looking ahead, it is very hard to tell what 1988 will bring. The wild market gyrations of recent weeks undoubtedly will have an impact on consumer spending, and to a lesser extent on business investment. Feldstein said it could knock 2 percentage points or more off GNP growth next year. Part of that would be due to a rise in consumer savings.

Normally, such a prospect would not have so many economists and financial market participants plugging for a tighter federal budget. But with foreign capital flows so vital to the level of U.S. interest rates, these are not normal times.

The clear hope is that interest rate reductions would offset the restraining influence on the economy from a declining budget deficit.

In any event, financial market participants, shell-shocked by the events of the past three weeks, are focusing on the budget deficit as a litmus test for U.S. leadership.