Skip to content

Commit

Permalink
Merge pull request #98 from primitivefinance/fix/minor-issues
Browse files Browse the repository at this point in the history
Fix/minor issues
  • Loading branch information
clemlak authored Apr 1, 2024
2 parents 86b6b0b + af6ac26 commit 62eeb36
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 8 deletions.
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

0 comments on commit 62eeb36

Please sign in to comment.