diff --git a/contracts/src/libraries/LPMath.sol b/contracts/src/libraries/LPMath.sol index 04aa3a76b..147e9024e 100644 --- a/contracts/src/libraries/LPMath.sol +++ b/contracts/src/libraries/LPMath.sol @@ -749,11 +749,11 @@ library LPMath { return 0; } - // If the max bond amount is greater than or equal to the - // net curve trade, then Newton's method has terminated since + // If the max bond amount is less than or equal to the net + // curve trade, then Newton's method has terminated since // proceeding to the next step would result in reaching the // same point. - if (maxBondAmount >= uint256(_params.netCurveTrade)) { + if (maxBondAmount <= uint256(_params.netCurveTrade)) { return shareProceeds; } // Otherwise, we continue to the next iteration of Newton's @@ -840,7 +840,7 @@ library LPMath { /// /// (1) zeta > 0: /// - /// y_max_out(dz) = (z - dz) - zeta * ((z - dz) / z) - z_min + /// z_max_out(dz) = ((z - dz) / z) * (z - zeta) - z_min /// /// => /// @@ -848,7 +848,7 @@ library LPMath { /// /// (2) zeta <= 0: /// - /// y_max_out(dz) = (z - dz) - z_min + /// z_max_out(dz) = (z - dz) - z_min /// /// => ///