diff --git a/contracts/strategies/G3MStrategyLib.sol b/contracts/strategies/G3MStrategyLib.sol index e4f4e84c..c85d75ae 100644 --- a/contracts/strategies/G3MStrategyLib.sol +++ b/contracts/strategies/G3MStrategyLib.sol @@ -91,4 +91,13 @@ library G3MStrategyLib { deltaY = reserveY.divWadDown(reserveX).mulWadDown(reserveX + deltaX) - reserveY; } + + function computeDeltaXGivenDeltaY( + uint256 reserveX, + uint256 reserveY, + uint256 deltaY + ) internal pure returns (uint256 deltaX) { + deltaX = reserveX.divWadDown(reserveY).mulWadDown(reserveY + deltaY) + - reserveX; + } }