Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/minor issues #98

Merged
merged 9 commits into from
Apr 1, 2024
1 change: 0 additions & 1 deletion src/ConstantSum/ConstantSumMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ConstantSumParams } from "src/ConstantSum/ConstantSum.sol";
import { ONE } from "src/lib/StrategyLib.sol";

using FixedPointMathLib for uint256;
using FixedPointMathLib for int256;

function computeTradingFunction(
uint256[] memory reserves,
Expand Down
1 change: 0 additions & 1 deletion src/ConstantSum/ConstantSumSolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ contract ConstantSumSolver {
error NotEnoughLiquidity();

using FixedPointMathLib for uint256;
using FixedPointMathLib for int256;

struct Reserves {
uint256 rx;
Expand Down
1 change: 0 additions & 1 deletion src/ConstantSum/ConstantSumUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function encodeControllerUpdate(address controller)

function decodeFeeUpdate(bytes memory data) pure returns (uint256 swapFee) {
(, swapFee) = abi.decode(data, (UpdateCode, uint256));
return swapFee;
}

function decodePriceUpdate(bytes memory data)
Expand Down
2 changes: 1 addition & 1 deletion src/LogNormal/LogNormalMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function computeTradingFunction(
LogNormalParams memory params
) pure returns (int256) {
int256 a = Gaussian.ppf(int256(rX.divWadDown(L)));
int256 b = Gaussian.ppf(int256(rY.divWadDown(L.mulWadUp(params.mean))));
int256 b = Gaussian.ppf(int256(rY.divWadDown(L.mulWadDown(params.mean))));
return a + b + int256(params.width);
}

Expand Down
1 change: 0 additions & 1 deletion src/NTokenGeometricMean/NTokenGeometricMean.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ contract NTokenGeometricMean is NTokenStrategy {
int256 invariant;
address controller;
uint256 swapFee;
uint256 wX;
uint256 totalLiquidity;
uint256[] reserves;
uint256[] weights;
Expand Down
3 changes: 0 additions & 3 deletions src/lib/StrategyLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { FixedPointMathLib } from "solmate/utils/FixedPointMathLib.sol";
uint256 constant HALF = 0.5e18;
uint256 constant ONE = 1e18;
uint256 constant TWO = 2e18;
int256 constant I_ONE = int256(ONE);
int256 constant I_TWO = int256(TWO);
int256 constant I_HALF = int256(HALF);

using FixedPointMathLib for uint256;
using FixedPointMathLib for int256;
Expand Down
4 changes: 4 additions & 0 deletions test/utils/LogNormalArbitrage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ interface SolverLike {
returns (LogNormalParams memory);
}

int256 constant I_ONE = int256(ONE);
int256 constant I_TWO = int256(TWO);
int256 constant I_HALF = int256(HALF);

contract LogNormalArbitrage {
using FixedPointMathLib for uint256;
using FixedPointMathLib for int256;
Expand Down
Loading