Optimal exercise matching