In this study, we introduce an optimal pairs trading model and verify its performance in the commodity futures markets. Empirical evidence from commodity futures indicates the existence of significant mean reversion together with high peak and fat tails for the distribution of spread residuals. Therefore, we assume an Ornstein-Uhlenbeck process with the noise term driven by a Levy process with generalized hyperbolic distributed marginals. Our model not only provides trading signals, but also can be considered as a pair screening technique to rank all potential pairs for trade priority in terms of the distance to the expected profit-maximizing thresholds. Empirical examples and backtesting results obtained from commodity futures data show strong support for the profitability of the model even in the presence of transaction costs.