@magmaprotocol/magma-clmm-sdk 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1186,7 +1186,11 @@ var ClmmPoolUtil = class {
1186
1186
  coinB = new decimal_default(0);
1187
1187
  } else if (curSqrtPrice.lt(upperSqrtPrice)) {
1188
1188
  coinA = MathUtil.toX64_Decimal(liq).mul(upperPriceStr.sub(curSqrtPriceStr)).div(curSqrtPriceStr.mul(upperPriceStr));
1189
- coinB = MathUtil.fromX64_Decimal(liq.mul(curSqrtPriceStr.sub(lowerPriceStr)));
1189
+ const a = curSqrtPriceStr.sub(lowerPriceStr);
1190
+ const b = liq.mul(a);
1191
+ const c = MathUtil.fromX64_Decimal(b);
1192
+ coinB = c;
1193
+ console.log("########## a, b, c", a, b, c);
1190
1194
  } else {
1191
1195
  coinA = new decimal_default(0);
1192
1196
  coinB = MathUtil.fromX64_Decimal(liq.mul(upperPriceStr.sub(lowerPriceStr)));