First potatoes, then coffee, now wheat.

Three times in the past 10 days, federal regulators have uncovered evidence that speculators were trying to rig trading in a staple of the American diet.

In each case, the Commodity Futures Trading Commission (CFTC) took unprecedented action to protect consumers from artificially inflated prices.

It was the fear of market manipulation that led Congress in 1974 to create a federal regulatory agency for commodity marketrs. But it wasn't until last week that the agency demonstrated a willingness to use all its powers to bring order to the often-chaotic trading.

But simultaneous crises in three different markets have helped expose the problems confronting the understaffed and largely neglected CFTC, the only federal regulatory agency in Washington, D.C., still run by a Republican administration holdover.

Resistance to regulation in the commodities markets is so strong that the Chicago Board of Trade has arranged to have a federal judge hold a hearing in Chicago this afternoon on a request for an injunction overturning the CFTC's decision to halt trading in March wheat futures to prevent manipulation of the market.

The Chicago Board is the nation's oldest and most respected commodity exchange and controlling it is the least of the CFTC's problems.

The latest evidence of trouble in the potato market has led Sen. Frank Church (D-Idaho) to revive efforts to outlaw trading in potato futures. A drive to ban trading in cattle futures is being mounted by Rep. Neal Smith (D-Iowa), chairman of the House Small Business Committee. Smith claims the cattle futures market is used by meat processors to jack up the price of beef.

The CFTC has proven to be virtually powerless against the seamier side of the commodities business, the high-pressure salesmen who sell phony futures in gold, platinum and diamonds by telephone.

CFTC's legal authority is so limited and its staff so small that commodities conmen, after they are caught, just pack up their telephone boiler rooms, rewrite their sales pitch to make use of another legal loophole and go back into business.

CFTC's troubles in keeping the commodity markets clean will be aired next month when the Senate Agriculture Committee begins confirmation hearings on James Stone, the Democrat belatedly nominated by the White Hosue to head the commission.

Stone has no experience in the complex commodity business, but as insurance commissioner for Massachusetts, he established a reputation as a consumer advocate and "tough cop" who can police his territory.

That territory is a multibillion-dollar business that few outsiders can comprehend. Rather than dealing in real bushels of wheat or bags of potatoes or coffee, futures traders buy and sell contracts for delivery of a certain amount of the commodity at a specified date.

Organized to take the risk and quick price fluctuations out of the markets for farm products, trading has expanded rapidly in recent years as futures markets were organized to deal in everything from frozen chickens and orange juce to gold and home mortgages.

The exponential growth of commodities trading has far outstripped the growth of the commodity regulatory agency.

CFTC's enforcement division, its first line of defense against market abuses, has a backlog of cases and barely two dozen lawyers.

Last week the commission issued formal charges growing out of an investigation of coffee market manipulation nearly two years ago. The companies involved in that case have continued to trade in coffee futures since and CFTC officials are investigating subsequent abuses in coffee trading.

An authorization bill to keep CFTC in operation got through Congress last year on the day the agency was to go out of business and the CFTC has fared little better in the White House.

The Carter administration has let two Republican apointees run the commission for the last two years. CFTC's first chairman, William Bagley, was the only regulatory agency chief not immediately replaced when the Democrats took over.

Since Bagley resigned last fall to practice law in the commodity field, the acting chairman has been Gary Seevers, a politically independent technocrat appointed by Richard M. Nixon.

Seevers' term is about to expire and he is seeking renomination. The White House also has to decide whether to reappoint Commissioner Reed P. Dunn, whose term also is expiring.

No longer just an arm of the Department of Agriculture, the CFTC, however, is still beholden to agricultural interests in Congress, who vote on its budget and its top appointments.

For the farm state senators who will weigh the nomination of Stone to head the CFTC, the big question will be whether he can balance his determination to protect consumers with the commodity industry's traditional insistance on self-regulation.

The CFTC came down on the side of the public on that issue last week, in a decision that Seevers described as "a very close call for the commission."

Infuriating officials of the Chicago Board of Trade, who accused the commission of interferring with the "natural forces" of supply and demand, the CFTC halted trading in wheat futures for March delivery.

The CFTC acted after investigators found that four professional commodity traders controlled almost 90 percent of the contracts for March wheat delivery.

Unlike holdings of stock, which are a matter of public record, futures investments are a closely guarded secret. But public records showed that speculators held contracts calling for delivery of 11.8 million bushels of wheat, and the biggest single holder was entitled to delivery of 2.5 million bushels of wheat.

That was more than all the wheat in Chicago. Because of a smaller than usual crop, there were less than 2 million bushels of wheat available last week. A year ago there were neary 17 million bushels.

That shortage allowed the four speculators who had cornered the market to try to pull off what is known in the commodity trade as "a squeeze."

Most commodity futures contracts are settled not by delivering the carload of wheat or potatoes that the contract calls for, but by cash.

The person who sold the futures contract -- called "the short" -- pays the person who bought the contract -- known as "the long" -- the difference between the price of wheat.

But the "longs" who held 90 percent of the March wheat contracts refused to accept cash settlement and demanded delivery of the wheat. This is legal, but not common in the futures market, where only 3 percent of all contracts are ever delivered.

By demanding delivery, the speculators forced up the price of what little wheat was available. But with contracts out for delivery of five times as much wheat as was available, there was not enough wheat at any price.

That meant the "shorts" who had contracted to deliver wheat to the four speculators had only one place they could turn to get that wheat -- the same four speculators who controlled 90 percent of the market.

The speculators could demand any price they wanted for the wheat they held, because it was the only wheat in Chicago.

The CFTC headed off the ploy by freezing the wheat price where it was on Thursday, at $3.75 per bushel.

The agency got similar results 10 days ago, when a shortage and the potential for a squeeze developed in the potato market. In that case the New York Mercantile Exchange voluntarily halted potato futures trading with the encouragement of the CFTC.

Last week the CFTC accused a coffee company owned by the government of E1 Salvador and a group of American coffee brokers of illegally inflating the price of coffee in July 1977.

The coffee group allegedly bought 18 million pounds of coffee in New York and shipped it to Brazil, the world's largest coffee-exporting nation. This created a temporary shortage of coffee in New York which may have increased prices by as much as 20 cents a pound for a short time.

The CFTC is investigating subsequent efforts by coffee-producing nations to force up American prices by manipulating the coffee futures trading on the New York Coffee and Sugar Exchange.