Such combinations rarely occur but when they do there are often opportunities for very profitable trades

What is the correctly punctuated version of this sentence?
Such combinations rarely occur, but when they do, there are often opportunities for very profitable trades.