Hedge funds and other big commodity investors pumped a notional $13 billion into U.S. energy, grains and metals markets in the week to July 3, the biggest influx in at least two years, after a debt deal in Europe sparked a buying frenzy across the sector.

Led by surges in soybean, corn, gold and oil positions, the funds, known by the regulatory moniker "managed money", increased their bullish net long positions to above $77 billion for the week to July 3, according to Reuters calculations based on the U.S. Commodity Futures Trading Commission's weekly data.

Reuters data shows it was the biggest weekly increase in net longs since at least 2010.

Just five weeks ago, net longs held by hedge funds and other money managers in commodities were at their lowest levels for this year at $56 billion.

The 19-commodity Thomson Reuters-Jefferies CRB index surged 7.3 percent during the week to July 3, the biggest five-day rally since August 2009.

The run-up came after EU leaders reached an unexpected deal on the final trading day of June to try and help Spain and Italy reduce their soaring borrowing costs.

After months of twisting on the ebbs and flows of Europe's debt crisis, investors in commodities surged headlong into buying. Oil prices alone rose 9 percent -- their fourth highest in a session -- on the day of the EU deal.

But markets did not stay higher through that week as investors aggressive in "buying the rumor" of easing monetary policy dumped commodities later when the central banks of Europe, the UK and China all moved to stoke economic growth.

A week into the third quarter, commodities have remained volatile, with prices sometimes falling as much as they had risen in the previous session. Agricultural markets, particularly corn and soybeans, have gained the most, reacting to worries about a drought across the grain belt in the U.S. Midwest that has been decimating crops.

The spot contract for U.S. soybeans hit record highs of $16.75 per bushel in Chicago trade on Monday, while corn's most-active futures contract, December, hit a session peak above $7.32.

"No doubt agriculture is the king now in commodities, but I don't expect this rally to last beyond another month or so as demand destruction from high prices will set in, if not for the weather itself cooling as we go past the summer's peaks," said Shawn Hackett of Hackett Financial Services in Boynton Beach, Florida.

Total speculative holdings in 22 futures and options markets tracked by the CFTC rose 23.7 percent, or by 229,840 million contracts in the week to July 3, the first gain in three weeks.

The notional outright value of overall net long speculative holdings rose to $77.6 billion.

The notional figures are calculated by Reuters based on the change in net positions from a week ago, multiplied by the contract's value at the end of the period. Because most investors trade commodities on margin, the change in the value of positions is not directly equivalent to total investment.

The total value of holdings is only a portion of the amount of investor capital estimated to be allocated to commodity markets worldwide, much of which is invested in over-the-counter contracts, physical exchange funds or credit notes, or via banks, which are classified differently by the CFTC.

Additional CFTC data can be found at or or the CFTC website at http://www.cftc.gov/marketreports/commitmentsoftraders/index.htm (Reporting By Jonathan Leff and Barani Krishnan)