A commodity swap is an agreement whereby a floating (or market or spot) price is exchanged for a fixed price over a specified period.
In this swap, the user of a commodity would secure a maximum price and agree to pay a financial institution this fixed price. Then in return, the user would get payments based on the market price for the commodity involved.
On the other side, a producer wishes to fix his income and would agree to pay the market price to a financial institution, in return for receiving fixed payments for the commodity.
The vast majority of commodity swaps involve oil.