The overall economy may be struggling against a double-dip recession but in farm country the boom times have rarely been better.

Farmland prices are setting records and farmer incomes have been buoyed by exports and biofuels, easing the pain of some rough summer weather from drought, floods and fires.

Amid China's voracious appetite for grains and worries about climate hurting crops and food supplies in many countries, U.S. agriculture's attraction as the world's breadbasket has become a beacon for Wall Street.

Firms like Omaha-based Gavilon, owned by Ospraie, a hedge fund associated with George Soros and Canada-listed Ceres Global Ag have been buying up grain elevators from Wyoming to Toronto.

That is unusual: investors owning grain silos. But analysts say it's not what it seems. No one wants to hold corn as a long-term asset, like gold bullion. But storing and moving grain for others has now become a very profitable business.

William Wilson, a consultant and professor at North Dakota State University, said that 10 years ago you could store grain at elevators 2-1/2 to 3 cents per bushel per month. Now costs can be 8-10 cents a month depending on location or grain.

We've seen a lot of big new entrants into the agricultural commodity industry including White Box, Gavilon and others who are expanding, Wilson said, referring to Minnesota-based hedge fund White Box Advisers, once an owner of grain storage.

One reason has been the shift to ethanol having a bigger part of the market, where they demand quick access to corn on a 12-month basis, Wilson said.

Most of the time when you hear of private capital moving into agriculture they are talking about buying farms. But storage is a logistical function of the marketplace, he added.

Wilson said special market factors, such as changes to the Chicago Board of Trade wheat contract, have also had the cumulative effect of raising prices for grain storage.

It's very important that in the last five years the market price of storage has increased, Wilson said. That has provided incentives to construct storage and has provided incentive for new players to enter into this world.

Don Grambsch, president of Riverland Ag Corp, a Minnesota firm owned by Ceres, operates 14 grain facilities in Minnesota, North Dakota, Wyoming, New York and Ontario with capacity to store 50 million bushels of grain. He said they don't have investors storing grain as long-term holdings.

I have not heard of them wanting to buy physicals, he said. We are a conventional grain company and store for third party users ... They are not financial people, they are processors, beverage companies and so on.

FARMLAND PRICES SOAR

Wall Street investors and hedge funds also continue to push money into speculative vehicles like grain-related indexes and funds that trade grain derivatives. Corn gains in the last five years look almost as impressive as gold's.

But the traditional asset play on agriculture by Wall Street -- farmland -- has also pushed to dizzying heights.

The Chicago Federal Reserve Bank on Wednesday said farmland prices in the Midwest in the second quarter were up 17 percent from a year ago -- the biggest jump in 34 years.

Most of the 226 bankers questioned in its quarterly survey said they expect prices to level off in the next three months -- but a third also said they expected even more gains.

Demand for farmland remained strong from both farmers and investors, the Chicago Fed said.

It is the same story in the Plains. The Kansas City Fed on Monday released its own banker survey showing similar results with farmland values up more than 20 percent from a year ago.

University of Illinois economist Gary Schnitkey attributes the soaring value of farmland to the sluggish economy and the inability of the United States, the European Union and other sovereign debtors to come to grips with fiscal imbalances.

The threat of long-run instability places a premium on real assets over financial assets. This suggests that a more stable general economic outlook would lead to less aggressive growth in farmland prices, Schnitkey said.

(Reporting by Christine Stebbins; Editing by Peter Bohan)