From 558b7668949558c483c651f01262c7de4c58ecf8 Mon Sep 17 00:00:00 2001 From: clemlak Date: Fri, 29 Mar 2024 17:56:53 +0400 Subject: [PATCH] fix: use muldiv in NTokenG3M math --- src/NTokenGeometricMean/NTokenGeometricMeanMath.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NTokenGeometricMean/NTokenGeometricMeanMath.sol b/src/NTokenGeometricMean/NTokenGeometricMeanMath.sol index cc69b4a3..d1233cde 100644 --- a/src/NTokenGeometricMean/NTokenGeometricMeanMath.sol +++ b/src/NTokenGeometricMean/NTokenGeometricMeanMath.sol @@ -30,7 +30,7 @@ function computeDeltaGivenDeltaLRoundUp( uint256 deltaLiquidity, uint256 totalLiquidity ) pure returns (uint256) { - return reserve.mulWadUp(deltaLiquidity.divWadUp(totalLiquidity)); + return reserve.mulDivUp(deltaLiquidity, totalLiquidity); } function computeDeltaGivenDeltaLRoundDown( @@ -38,7 +38,7 @@ function computeDeltaGivenDeltaLRoundDown( uint256 deltaLiquidity, uint256 totalLiquidity ) pure returns (uint256) { - return reserve.mulWadDown(deltaLiquidity.divWadDown(totalLiquidity)); + return reserve.mulDivDown(deltaLiquidity, totalLiquidity); } function computeL(