@magmaprotocol/magma-clmm-sdk 0.4.1 → 0.4.2
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 +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -983,7 +983,11 @@ var ClmmPoolUtil = class {
|
|
|
983
983
|
coinB = new decimal_default(0);
|
|
984
984
|
} else if (curSqrtPrice.lt(upperSqrtPrice)) {
|
|
985
985
|
coinA = MathUtil.toX64_Decimal(liq).mul(upperPriceStr.sub(curSqrtPriceStr)).div(curSqrtPriceStr.mul(upperPriceStr));
|
|
986
|
-
|
|
986
|
+
const a = curSqrtPriceStr.sub(lowerPriceStr);
|
|
987
|
+
const b = liq.mul(a);
|
|
988
|
+
const c = MathUtil.fromX64_Decimal(b);
|
|
989
|
+
coinB = c;
|
|
990
|
+
console.log("########## a, b, c", a, b, c);
|
|
987
991
|
} else {
|
|
988
992
|
coinA = new decimal_default(0);
|
|
989
993
|
coinB = MathUtil.fromX64_Decimal(liq.mul(upperPriceStr.sub(lowerPriceStr)));
|