Skip to content

Commit

Permalink
mulDiv
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanSanderson committed Feb 25, 2024
1 parent c37e6fc commit f46d5ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pumps/MultiFlowPump.sol
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ contract MultiFlowPump is IPump, IMultiFlowPumpErrors, IInstantaneousPump, ICumu
crv.rLimit = tempExp.cmp(MAX_CONVERT_TO_128x128) != -1
? crv.rLimit = type(uint256).max
: crv.rLast.mulDivOrMax(tempExp.to128x128().toUint256(), CAP_PRECISION2);
if (cappedReserves[i] * CAP_PRECISION / cappedReserves[j] > crv.rLimit) {
if (cappedReserves[i].mulDiv(CAP_PRECISION, cappedReserves[j]) > crv.rLimit) {
crv.ratios = new uint256[](2);
crv.ratios[i] = crv.rLimit;
crv.ratios[j] = CAP_PRECISION;
Expand All @@ -289,7 +289,7 @@ contract MultiFlowPump is IPump, IMultiFlowPumpErrors, IInstantaneousPump, ICumu
.toUint256(),
CAP_PRECISION2
);
if (cappedReserves[i] * CAP_PRECISION / cappedReserves[j] < crv.rLimit) {
if (cappedReserves[i].mulDiv(CAP_PRECISION, cappedReserves[j]) < crv.rLimit) {
crv.ratios = new uint256[](2);
crv.ratios[i] = crv.rLimit;
crv.ratios[j] = CAP_PRECISION;
Expand Down

0 comments on commit f46d5ff

Please sign in to comment.