Skip to content

Commit 5097bb6

Browse files
committed
remove unused y0, clean-up pre-conditions
1 parent fb3c1e1 commit 5097bb6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libraries/CurveExtrasLib.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ import {Math} from "openzeppelin-contracts/utils/math/Math.sol";
55

66
library CurveExtrasLib {
77
/// @dev EulerSwap derivative helper function to find the price after a swap
8-
/// Pre-conditions: 0 < x <= x0, 1 <= {px,py} <= 1e36, {x0,y0} <= type(uint112).max, c <= 1e18
9-
function df_dx(uint256 x, uint256 px, uint256 py, uint256 x0, uint256 y0, uint256 c)
10-
internal
11-
pure
12-
returns (int256)
13-
{
8+
/// Pre-conditions: 0 < x <= x0 <= type(uint112).max, 1 <= {px,py} <= 1e36, c <= 1e18
9+
function df_dx(uint256 x, uint256 px, uint256 py, uint256 x0, uint256 c) internal pure returns (int256) {
1410
uint256 r = Math.mulDiv(x0 * x0 / x, 1e18, x, Math.Rounding.Ceil);
1511
return -int256(px * (c + (1e18 - c) * r / 1e18) / py);
1612
}

0 commit comments

Comments
 (0)