It has been one of the worst years in recent history for commodities, and the numbers prove it. The Bloomberg Commodity Index is down 22%, and this puts the index at its lowest levels in 16 years—since 1999.

While these may be substantial declines, it also means opportunity. It is certainly impossible to predict whether or not commodities have bottomed, but fortunately this is not necessary. All that is required is to build a case that the upside far exceeds the downside and then pick fundamentally strong companies. Make sure that these companies combined represent a small portion of your overall portfolio (10-15%) to manage your risk.

What is a fundamentally strong commodity company? It’s a company that sells a commodity that shows signs of bottoming, has a competitive advantage, and may be undervalued. Some top ideas that fit these criteria are Teck Resources Ltd. (TSX:TCK.B)(NYSE:TCK) and Potash Corporation of Saskatchewan Inc. (TSX:POT)(NYSE:POT).

Teck Resources has much more upside than downside

Teck is primarily a producer of metallurgical coal, which is used to make steel. Teck’s stock was battered in 2015, falling over 50% and recently hitting lows not seen since 2000 (and even then, only very briefly).

There are signs, however, that the market for metallurgical coal is bottoming. While the demand picture for coal is still weak since the largest consumer—China, which is responsible for half of global coal consumption—is still suffering from quickly declining steel production, there is hope from the supply side.

Part of the reason why coal has seen such price weakness is due to massive oversupply, but in 2014 and 2015, RBC estimates that 34 million tonnes of curtailments and closures have taken place. This is expected to increase even further. According to Wood Mackenzie, 65% of global coal production is currently operating at a loss. Even in Australia, where some of the lowest-cost mines operate, about half of mines are making a loss.

In the U.S.—where producers do not get the same boost as Canadian, Australian, or Russian producers by translating U.S. dollar coal revenues into weaker currencies—several producers have filed for bankruptcy and high-cost production is being taken offline.

With this, many analysts are now predicting that coal will see flat to slightly rising prices going forward. Teck is ready to benefit, because it has some of the lowest-cost coal production. Teck’s costs were US$64 per tonne in the last quarter, which is still below coal prices, which are currently US$74 per tonne.

This is competitive with low-cost Australian producers like Anglo-American, which has unit costs of US$58 per tonne, or BHP Billiton, which has similar operating costs to Teck.

At the same time, Teck is trading at a massive 80% discount to its net asset value as well as at a 2017 price-to-earnings ratio that is only one-quarter of its peer-group average.

Potash Corporation is also poised for upside

Unlike Teck, which has seen plunging demand for its key product, Potash Corp. is expecting global demand to grow, and potash demand has been in a steady uptrend. Potash demand has grown steadily from about 40 million tonnes annually in 2000 to the current levels of about 60 million tonnes.

This year, demand is expected to come in at about 58 million tonnes, which many see as being bearish, since it represents a large decline from the record-setting levels of 62.7 million tonnes in 2014.

It is important to note, however, that this year’s lower demand is widely speculated to be due to inventory drawdown from the massive inventories built in 2014 rather from than a huge drop in demand. In 2016 demand is expected to be 61 million tonnes.

While potash prices have seen a massive drop, strong demand coupled with the facts that new supply is still a few years away and potash is managed by largely disciplined producers means prices may be at or near a bottom.

Potash Corp. is the world’s largest producer of potash in an industry with only a handful of producers. It is also one of the world’s lowest-cost producers with only two eastern European producers having lower operating costs on a per-tonne basis.

With prices down 41% year-to-date, now is an opportunity to get Potash Corp. at a discount.

Dividends are more important than ever in these weak market conditions

These three top stocks have delivered dividends for shareholders for decades (and even centuries!). Check out our special FREE report: "3 Dividend Stocks to Buy and Hold Forever". Click here now to get the full story!

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Adam Mancini has no position in any stocks mentioned.