From 7532570b68ee8f45da8e13b3d3e701f65a981158 Mon Sep 17 00:00:00 2001 From: Alex Towle Date: Sun, 25 Feb 2024 00:18:55 -0600 Subject: [PATCH] Fixed rounding conditional in `calculateSharesInGivenBondsOutDerivativeSafe` --- contracts/src/libraries/LPMath.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/src/libraries/LPMath.sol b/contracts/src/libraries/LPMath.sol index db2624aad..e7b754f06 100644 --- a/contracts/src/libraries/LPMath.sol +++ b/contracts/src/libraries/LPMath.sol @@ -1434,7 +1434,7 @@ library LPMath { k - inner, _params.presentValueParams.vaultSharePrice ); - if (inner >= 0) { + if (inner >= ONE) { // NOTE: Round the exponent up since this rounds the result up. inner = inner.pow( _params.presentValueParams.timeStretch.divUp(