Skip to content

Commit

Permalink
fix: Change BaseMath rounding to match latest SC.
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrantuk committed Jul 29, 2024
1 parent 1c0c016 commit 43c146b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typescript/src/vault/basePoolMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function computeAddLiquiditySingleTokenExactOut(
// Calculate the taxable amount, which is the difference
// between the actual amount in and the non-taxable balance
const nonTaxableBalance = MathSol.divDownFixed(
MathSol.mulUpFixed(newSupply, currentBalances[tokenInIndex]),
MathSol.mulDownFixed(newSupply, currentBalances[tokenInIndex]),
totalSupply,
);

Expand Down Expand Up @@ -209,7 +209,7 @@ export function computeRemoveLiquiditySingleTokenExactIn(
const amountOut = currentBalances[tokenOutIndex] - newBalance;

// Calculate the non-taxable balance proportionate to the BPT burnt.
const nonTaxableBalance = MathSol.divDownFixed(
const nonTaxableBalance = MathSol.divUpFixed(
MathSol.mulUpFixed(newSupply, currentBalances[tokenOutIndex]),
totalSupply,
);
Expand Down

0 comments on commit 43c146b

Please sign in to comment.