File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ func (k Keeper) computeOutAmtGivenIn(
493493
494494 // Coin amounts require int values
495495 // Round amountIn up to avoid under charging
496- amountIn := (tokenInMin .Amount .ToLegacyDec ().Sub (swapState .amountSpecifiedRemaining )).Ceil ().TruncateInt ()
496+ amountIn := (tokenInMin .Amount .ToLegacyDec ().SubMut (swapState .amountSpecifiedRemaining )).Ceil ().TruncateInt ()
497497 // Round amountOut down to avoid over distributing.
498498 amountOut := swapState .amountCalculated .TruncateInt ()
499499
@@ -620,7 +620,7 @@ func (k Keeper) computeInAmtGivenOut(
620620 amountIn := swapState .amountCalculated .Ceil ().TruncateInt ()
621621
622622 // Round amount out down to avoid over charging the pool.
623- amountOut := desiredTokenOut .Amount .ToLegacyDec ().Sub (swapState .amountSpecifiedRemaining ).TruncateInt ()
623+ amountOut := desiredTokenOut .Amount .ToLegacyDec ().SubMut (swapState .amountSpecifiedRemaining ).TruncateInt ()
624624
625625 ctx .Logger ().Debug ("final amount in" , amountIn )
626626 ctx .Logger ().Debug ("final amount out" , amountOut )
You can’t perform that action at this time.
0 commit comments