From 43582453ecd9d0fa525f0335f5d957b415b20457 Mon Sep 17 00:00:00 2001 From: theGreatPanini <88137486+theGreatPanini@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:32:20 +0000 Subject: [PATCH] Fix formula in calcPoolInGivenSingleOut comment block Corrected the token weight variable in the calcPoolInGivenSingleOut function's comment block from (tO / tW) to the correct (wO / tW). This change ensures that the documentation accurately reflects the calculation based on the token's weight (wO) relative to the total weight (tW), rather than an undefined variable (tO). --- contracts/BMath.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/BMath.sol b/contracts/BMath.sol index ed2e39b6..9ceb79fc 100644 --- a/contracts/BMath.sol +++ b/contracts/BMath.sol @@ -227,7 +227,7 @@ contract BMath is BBronze, BConst, BNum { // calcPoolInGivenSingleOut // // pAi = poolAmountIn // / tAo \\ / wO \ \ // // bO = tokenBalanceOut // | bO - -------------------------- |\ | ---- | \ // - // tAo = tokenAmountOut pS - || \ 1 - ((1 - (tO / tW)) * sF)/ | ^ \ tW / * pS | // + // tAo = tokenAmountOut pS - || \ 1 - ((1 - (wO / tW)) * sF)/ | ^ \ tW / * pS | // // ps = poolSupply \\ -----------------------------------/ / // // wO = tokenWeightOut pAi = \\ bO / / // // tW = totalWeight ------------------------------------------------------------- //