Skip to content

Commit

Permalink
fix: use prepareSwapPtIn
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Jun 13, 2024
1 parent 3a31b44 commit ba84579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RMM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ contract RMM is ERC20 {
uint256 max = initialGuess;
for (uint256 iter = 0; iter < 100; ++iter) {
uint256 guess = (min + max) / 2;
(,, uint256 amountOut,,) = prepareSwapSy(guess, blockTime, index);
(,, uint256 amountOut,,) = prepareSwapPtIn(guess, blockTime, index);
uint256 netPtToAccount = index.assetToSyUp(guess);

uint256 netPtToPull = netPtToAccount - amountOut;
Expand Down

0 comments on commit ba84579

Please sign in to comment.