Skip to content

Commit

Permalink
Removing the code with less precision and uncommenting the code with …
Browse files Browse the repository at this point in the history
…more precision
  • Loading branch information
Luiz Gustavo Abou Hatem De Liz committed Mar 7, 2024
1 parent de36edc commit 0524628
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/router/sorClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,8 @@ function iterateSwapAmountsApproximation(
// 1.042818e-12 while using normal js math operations it was
// 1.0428184989387553e-12. This loss of precision caused an important bug

// let weighted_average_SPaS = sumSPaSDividedByDerivativeSPaSs.div(
// sumInverseDerivativeSPaSs
// );
const weighted_average_SPaS = bnum(
sumSPaSDividedByDerivativeSPaSs.toNumber() /
sumInverseDerivativeSPaSs.toNumber()
const weighted_average_SPaS = sumSPaSDividedByDerivativeSPaSs.div(
sumInverseDerivativeSPaSs
);

swapAmounts.forEach((swapAmount, i) => {
Expand Down

0 comments on commit 0524628

Please sign in to comment.