GREENWICH, CONN. -- In the trading room of Phibro Energy Inc., a restless sea of well-cut shirts and colorful computer screens, David Hammer has just paid $23.50 a barrel to purchase more than 1 million barrels of oil that won't be pumped out of the ground until next summer. In less than five minutes, without leaving his desk, he has resold it for $24 a barrel.

Profit for Phibro, the oil-trading division of Wall Street brokerage firm Salomon Brothers Inc.: at least $500,000.

Only in the new world of oil are such deals possible. It began when Hammer got a phone call from an oil executive in the western United States who wanted to lock in his company's revenue for 1991. Like most people in the business, this oilman expects the price of a barrel of crude oil to drop from $28 at the time of the phone call in early December to less than $18 when the Persian Gulf crisis is resolved. The oilman probably won't get $28 for the oil he will produce next year, but he didn't want to settle for $18 if he can help it. So he called Hammer, who agreed to buy a big part of his output for $23.50.

This looks like a foolish gamble for Hammer and Phibro Energy. Why would they buy oil for $23.50 that will probably be available for $18? But in fact, Hammer and Phibro Energy can't lose. Hammer already has unloaded the oil, on paper at least, at $24. He did it by selling contracts to deliver an equivalent amount of oil next summer through the New York Mercantile Exchange, the futures market at the World Trade Center in Manhattan, for that price.

Why is oil for July delivery going at $24? Because that's what traders worldwide are willing to pay for it, for whatever reason. Hammer knows that whatever happens in Iraq, whatever the future policy of the Organization of Petroleum Exporting Countries, he's ahead at least 50 cents a barrel -- and somebody else is taking the risk of prices going up or down in the interim. And because futures contracts are paid for the day they are sold, he will get his money right away, while he doesn't have to pay the western producer for his "wet barrels" until they come out of the ground during the next year.

If the daily cash price is above $23.50 when that oil comes out of the ground, Phibro Energy pockets the difference. If it's below $23.50, Phibro Energy still comes out ahead because it will be paying $23.50 for oil already sold at $24.

"Phibro Energy has the international resources, trading savvy and analytical backup to do this," Hammer said. "That's why the producer uses us. What he gives up is the opportunity to make a real killing" if the price is much above $23.50.

Phibro Energy says it is the world's biggest oil trading company. It has agents all over the world, buys and sells crude oil and refined products, charters more than 1,200 tankers a year, manages "hedging" deals such as Hammer's and operates four refineries in the United States.

For 1989, Phibro Energy reported pretax income of $390 million on sales of $21.3 billion. By comparison, Texaco Inc. reported 1989 sales of $35.6 billion.