From a04d14825ed81baef143a18102f9ac9f0f21436b Mon Sep 17 00:00:00 2001 From: clemlak Date: Thu, 7 Dec 2023 15:52:17 +0400 Subject: [PATCH] feat: update S and IS functions --- contracts/strategies/G3MStrategyLib.sol | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/contracts/strategies/G3MStrategyLib.sol b/contracts/strategies/G3MStrategyLib.sol index 49078f46..9c09d782 100644 --- a/contracts/strategies/G3MStrategyLib.sol +++ b/contracts/strategies/G3MStrategyLib.sol @@ -148,7 +148,7 @@ library G3MStrategyLib { uint256 t, uint256 w0, uint256 w1 - ) internal pure returns (uint256 x) { + ) internal pure returns (uint256) { uint256 boop = uint256( int256( FixedPointMathLib.WAD.divWadUp(w0.mulWadUp(t) + w1) @@ -160,13 +160,12 @@ library G3MStrategyLib { - (FixedPointMathLib.WAD.divWadUp(FixedPointMathLib.WAD + boop)); } - function computeISFunction(uint256 t) internal pure returns (uint256 x) { + function computeISFunction(uint256 x) internal pure returns (uint256) { uint256 boop = uint256( int256( - FixedPointMathLib.WAD.divWadUp( - FixedPointMathLib.WAD - t - FixedPointMathLib.WAD - ) - ).powWad(-(int256(FixedPointMathLib.WAD.divWadUp(2)))) + FixedPointMathLib.WAD.divWadUp(FixedPointMathLib.WAD - x) + - FixedPointMathLib.WAD + ).powWad(-0.5 ether) ); return FixedPointMathLib.WAD.divWadUp(FixedPointMathLib.WAD + boop); }