Skip to content

Commit

Permalink
feat: add computeISFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Dec 5, 2023
1 parent 15ef80a commit 1585ef2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contracts/strategies/G3MStrategyLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,15 @@ library G3MStrategyLib {
return FixedPointMathLib.WAD
- (FixedPointMathLib.WAD.divWadUp(FixedPointMathLib.WAD + boop));
}

function computeISFunction(uint256 t) internal pure returns (uint256 x) {
uint256 boop = uint256(
int256(
FixedPointMathLib.WAD.divWadUp(
FixedPointMathLib.WAD - t - FixedPointMathLib.WAD
)
).powWad(-(int256(FixedPointMathLib.WAD.divWadUp(2))))
);
return FixedPointMathLib.WAD.divWadUp(FixedPointMathLib.WAD + boop);
}
}

0 comments on commit 1585ef2

Please sign in to comment.