Skip to content

Commit

Permalink
feat: add computeDeltaLGivenDeltaY
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Feb 23, 2024
1 parent d0c6544 commit 29b0aa8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/StrategyLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ function computeDeltaLGivenDeltaX(
return liquidity.mulWadDown(deltaX.divWadDown(reserveX));
}

function computeDeltaLGivenDeltaY(
uint256 deltaY,
uint256 liquidity,
uint256 reserveY
) pure returns (uint256 deltaL) {
return liquidity.mulWadDown(deltaY.divWadDown(reserveY));
}

function computeDeltaYGivenDeltaX(
uint256 deltaX,
uint256 reserveX,
Expand Down

0 comments on commit 29b0aa8

Please sign in to comment.