That is called counterparty risk and the clearing corporation of these exchanges takes care of the same. This is exactly like it operates on the BSE and the NSE in the equity and F&O segment. In a sense the market mechanism in case of commodity futures is akin to that of stock futures. When you trade through the stock exchange or the commodity exchange the exchange clearing corporation guarantees each trade executed on the exchange. Effectively, the clearing corporation becomes the counterparty for each trade. So if A is the buyer of gold and B is the seller of gold, then both A and B actually trade with the clearing corporation as the counterparty. But how does the exchange guarantee each trade? The exchange has the broker margins to fall back upon. It is precisely for this reason that the clearing corporation holds something called the Trade Guarantee Fund (TGF) which they can fall back upon in the event of making good any transaction. This makes the entire process of trading, clearing and settlement a lot safer.