The Federal Reserve has had its eye on commodities prices for some time now, but the concern ratcheted up Wednesday as Atlanta Fed President Jack Guynn and former Fed Chairman Alan Greenspan each warned that the volatile markets could threaten economic stability. Their comments contributed to weakness in commodities and related stocks, the latter helping pull major averages into negative territory.

Behind the scenes, the commodities markets may have only narrowly avoided a much bigger crisis, which another branch of the federal government helped smooth over.

In an unusual move, the Internal Revenue Service extended a crucial deadline for commodity mutual funds to adjust their portfolios to come into compliance with the tax code from June 29 to Sept. 30. If the IRS was not so flexible both in its initial December ruling and its more recent extension, $14 billion worth of commodities mutual funds most likely would have liquidated sometime near the start of the year, including the $12 billion

(PCRIX) - Get Report

Pimco Commodity RealReturn Strategy fund. Such unwinding of these derivatives trades could have created a minor disaster in the commodities markets, recently under pressure as the Fed ratchets up its anti-inflationary rhetoric.

"When you swing $14 billion through small markets, it creates a potential mess," says Howard Simons, strategist at Bianco Research and

RealMoney.com

contributor. "Some of these markets are surprisingly small," and the ultimate delivery of the underlying product is physically constrained. One could arguably buy all the corn produced in the U.S. last year for about $27 billion, he notes.

Here is the back story: Commodities mutual funds, including Pimco's Commodity RealReturn Strategy Fund, had been using derivative contracts called "total return swaps" to gain exposure to commodities. On Friday, the IRS reiterated its December ruling that commodities-oriented mutual funds' income from derivatives contracts is not "qualifying income." That means these funds don't qualify as meeting the requirements of being a mutual fund, and therefore would be compelled to liquefy assets and close.

Mutual funds are just like corporations in many ways. They have shareholders. They have boards of directors. But they differ in that they don't pay corporate taxes. In order to obtain that status from the IRS, they have to make money from IRS-approved sources. The IRS deemed these commodities derivatives "bad" income.

The ruling Friday allowed the funds to take another three months to transition away from the "bad" derivatives contracts. The funds are in the process of switching their derivatives contracts into structured notes, income from which is typically considered "qualifying income."

The IRS says it granted the extra time because of "a supply-and-demand imbalance" for the structured notes, meaning that the funds expressed problems transferring their portfolios to structured notes, which are expensive and not so easy to drum up. Pimco's fund announced last month that it is 95% done with its transition, but it is the other funds having the trouble, says Karen Dolan, mutual fund analyst at Morningstar. The other funds are smaller and less experienced with structured products, she says.

"Pimco's big size attracts counterparties and people who want to do that business with them," says Dolan.

The demand for structured notes is so strong that the $2 billion

(ORAAX)

Oppenheimer Real Asset fund closed itself to new investors in part due to the difficulty it was having finding counterparties with whom to structure the notes, she says.

Oppenheimer's fund was not impacted by the IRS ruling, however, because it used structured notes from the get-go, says a spokeswoman for the fund family.

Other funds that may be affected include

(CRSAX) - Get Report

Credit Suisse Commodity Return Strategy,

(POCMX)

Direxion Commodity Bull and

(RYMEX) - Get Report

Rydex Commodity Securities, according to Dolan.

Because of the higher cost of the structured notes, some of the smaller funds wanted to wait until the original June 29 deadline neared to start the adjustments to their portfolios, says Dolan. Their delay created the need for the IRS extension. "It was a combination of not managing the timing properly and not realizing how difficult it may be to put these contracts in place," she says.

There were private-letter rulings issued in this area, says Bruce Friedland, an IRS spokesman, but he declined to specify to which fund firms. Private-letter rulings are special permissions granted to individual taxpayers at their request. The flexibility granted in such letters does not apply outside that specific situation. Perhaps the IRS does not want to paint approval with broad brush strokes to structured notes -- a type of instrument that can be so specific and tailored.

The situation is "very unusual," says Robert Willens, tax and accounting analyst at Lehman Brothers. "It is an amazing set of circumstances." And the fix isn't necessarily in. The language of the ruling Friday does not explicitly guarantee that all structured notes, the presumptive solution, generate qualifying income, he says.

Dolan notes that the IRS was concerned about hurting individual investors. But "how often does the IRS take into account the impact of its rules on markets?" Willens wonders. "Very rarely."

The IRS won't go so far as to say it is concerned about the commodities market, but it acknowledges the volatility its rules can sometimes create. "The relief provided in the ruling is an effort to help the investment community manage transitions right," says Friedland. "We understand that need."

Whatever the IRS motivation, crisis may have been averted -- at least for now. The IRS can't do much about commodities prices' impact on inflation, though.

The Fed can try, however, and that is the focus of the stock market, which took another knock after Greenspan said higher energy prices are starting to have "some impact" on the U.S. economy. More dramatically, Guynn said: "Core inflation, which excluded volatile food and energy costs, has moved into the upper end of -- or beyond -- the range I consider acceptable over time."

When Guynn's comments hit the tape early Wednesday afternoon, a decent rally in the major averages reversed sharply. After trading as high as 11,077.38, the

Dow Jones Industrial Average

closed down 0.65% to 10,930.90, its first close below 11,000 since March 9.

The

S&P 500

shed 0.6% to 1256.15 after trading as high as 1,272.47. The

Nasdaq Composite

rose nearly 1% to 2,184.44 at its apex, but finished down 0.5% at 2151.80.

Major averages were hurt, most notably, by weakness in chip stocks such as

Intel

(INTC) - Get Report

and

Broadcom

(BRCM)

, as well as energy stocks such as

Exxon Mobil

(XOM) - Get Report

and

Schlumberger

(SLB) - Get Report

.

In keeping with TSC's editorial policy, Rappaport doesn't own or short individual stocks. She also doesn't invest in hedge funds or other private investment partnerships. She appreciates your feedback. Click

here

to send her an email.