Farmers can lock in prices with contracts
For example, the farmer can lock in the price of wheat at planting time, with a contract agreement to deliver a certain tonnage of wheat to a specified place, on a certain date in the future, for a certain fixed price.
The farmer no longer worries about a low wheat price at harvest time, but also gives up the chance at making extra money from a high wheat price.