diff --git a/package.json b/package.json index 74b2a0f4..6ce541bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer-labs/sor", - "version": "4.1.1-beta.5", + "version": "4.1.1-beta.6", "license": "GPL-3.0-only", "main": "dist/index.js", "module": "dist/index.esm.js", diff --git a/src/pools/linearPool/linearMath.ts b/src/pools/linearPool/linearMath.ts index 234f8ed3..df6bbbf9 100644 --- a/src/pools/linearPool/linearMath.ts +++ b/src/pools/linearPool/linearMath.ts @@ -1,4 +1,4 @@ -import { MathSol } from '../../utils/basicOperations'; +import { MathSol, BZERO } from '../../utils/basicOperations'; type Params = { fee: bigint; @@ -395,7 +395,7 @@ export function _calcTokensOutGivenExactBptIn( // multiplication and division. const bptRatio = MathSol.divDownFixed(bptAmountIn, bptTotalSupply); - const amountsOut: bigint[] = new Array(balances.length); + const amountsOut: bigint[] = new Array(balances.length).fill(BZERO); for (let i = 0; i < balances.length; i++) { // BPT is skipped as those tokens are not the LPs, but rather the preminted and undistributed amount. if (i != bptIndex) {