In the two months before a crucial vote on commodity trading taxes in the House Ways and Means Committee, commodity industry political action committees passed out contributions to 10 committee members, Federal Election Commission records show.

Nine of those who got the money voted for a bill that would have saved the industry $400 million a year in federal taxes.

Ten other Ways and Means members who received contributions from commodity sources in the last 18 months also voted for the bill, which was drafted with the involvement of commodity lobbyists.

In all, 22 of the 35 committee members received commodity contributions, and 19 of them sided with the industry on its most critical test in Congress this year.

Those 19 votes were decisive in a 27-to-8 committee vote to exempt professional commodity speculators from a crackdown on use of commodity markets to avoid paying income taxes.

The measure was eventually killed by a House-Senate conference committee, but not until after the Democratic-controlled House voted in favor of the commodity industry's language. In the two months before the House vote, Democratic congressional campaign groups collected $22,000 from three commodity industry political action committees.

Campaign fund-raising reports for the first six months of 1981 show the contributions came from $625,000 raised by the Auction Markets Political Action Committee of the Chicago Board of Trade, the Commodity Futures Political Fund of the Chicago Mercantile Exchange and the Commodity Exchange Inc. Political Action Committee of New York.

Most such committees concentrate their efforts in election years, but the three commodity PACs raised more money in the first six months of this nonelection year than they spent during the 1980 campaigns, when they donated about $460,000 to 200 candidates.

The three commodity industry PACs passed out $115,000 during the first half of 1980, the FEC reports show.

The reports cover contributions made before July 1. On that date, the three committees still had the $625,000 they had collected but not distributed. The PACs do not have to report how they used that money until February.

Much of the $115,000 already distributed went to legislators able to directly influence commodity legislation. The top item on the industry's agenda was a proposal sponsored by congressional Democrats and backed by the administration to close an income-tax loophole known as the commodity straddle. Commodity traders use straddles to escape paying an estimated $1.4 billion a year in taxes, the Treasury Department says.

The commodity traders lost the fight last week when the tax bill cut the legs out from under the tax straddle. But the industry persuaded Congress to cut the maximum federal income-tax rate on commodity trading profits from 70 to 32 percent, and to create a favorable transition to the new tax treatment.

The commodity industry was caught off-guard when the Senate voted to outlaw the straddle. When the action shifted to the House, the three commodity PACs began passing out cash to members of the committee that would deal with the bill:

May 1: $250 to Kent Hance (D-Tex.); May 4: $250 to Marty Russo (D-Ill.); May 6: $500 to James R. Jones (D-Okla.); May 19: $500 to Thomas J. Downey (D-Calif.); May 25: $1,000 to Harold E. Ford (D-Tenn.); June 9: $500 to Frank J. Guarini (D-N.J.) and $500 to W. Henson Moore (R-La.); June 15; $500 to Wyche Fowler Jr. (D-Ga.); June 16: $500 to Robert T. Matsui (D-Calif.) and $500 to Cecil Heftel (D-Hawaii).

When Ways and Means voted on July 11, all but Fowler went along with the commodity industry's position.

Chairman Dan Rostenkowski (D-Ill.) got none of the last-minute cash, but collected $8,000 from the three PACs in 1980. Hance, who played a crucial role in the tax bill, received $1.750 in three installments during May and June -- on top of $2,125 last year.

A total of $3,000 in contributions went to Russo, who introduced the industry bill written with the help of Leo Melamed and Leslie Rosenthal, two prominent Chicago commodity traders.

Other Ways and Means members who earlier received contributions from the commodity PACs and voted for the industry-backed bill were: John J. Duncan (D-Tenn.), Richard A. Gephardt (R-Mo.), Sam M. Gibbons (D-Fla.), Ed Jenkins (D-Ga.), James G. Martin (R-N.C.), J. J. (Jake) Pickle (D-Tex.), Richard T. Schulze (R-Pa.), and Guy Vander Jagt (R-Mich.).