Skip to content

Commit

Permalink
feat: update S and IS functions
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Dec 7, 2023
1 parent 183d108 commit a04d148
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions contracts/strategies/G3MStrategyLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit a04d148

Please sign in to comment.