def getLimOrderValue(odds, volume):
        """ Calculate max price matched (to lay) and min (to back) in order to place a limit order """
        if volume>0: #BACK
                odds_back = odds[odds[:,1]>0]
                odds_back = odds_back[odds_back[:,0].argsort()]
                odds_back = odds_back[::-1]
                odds_back[:,1] = odds_back[:,1].cumsum(axis=0)
                pos = odds_back[:,1]>volume
                lim_value = odds_back[pos][0][0]
        else: # LAY
                odds_lay = odds[odds[:,1]<0]
                odds_lay = odds_lay[odds_lay[:,0].argsort()]
                odds_lay[:,1] = odds_lay[:,1].cumsum(axis=0)
                pos = odds_lay[:,1]<volume
                lim_value = odds_lay[pos][0][0]

        return lim_value