From 5deadfaadc8bc922c4f7d066ba06c8eba7ab794e Mon Sep 17 00:00:00 2001 From: johngrantuk Date: Tue, 25 Oct 2022 10:27:58 +0100 Subject: [PATCH] Fix WeightedMath bug. --- package.json | 2 +- src/pools/weightedPool/weightedMath.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dff66fb5..9a7aadd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer-labs/sor", - "version": "4.0.1-beta.7", + "version": "4.0.1-beta.8", "license": "GPL-3.0-only", "main": "dist/index.js", "module": "dist/index.esm.js", diff --git a/src/pools/weightedPool/weightedMath.ts b/src/pools/weightedPool/weightedMath.ts index 4a7f0e1c..142683a1 100644 --- a/src/pools/weightedPool/weightedMath.ts +++ b/src/pools/weightedPool/weightedMath.ts @@ -583,7 +583,7 @@ export function _spotPriceAfterSwapExactBPTInForTokenOut( ); const wo = parseFloat(formatFixed(poolPairData.weightOut, 18)); const Aibpt = amount.toNumber(); - const f = parseFloat(formatFixed(poolPairData.swapFee.toNumber())); + const f = parseFloat(formatFixed(poolPairData.swapFee)); return bnum( ((1 - Aibpt / Bbpt) ** ((-1 + wo) / wo) * Bbpt *