@magmaprotocol/magma-clmm-sdk 0.5.86 → 0.5.87
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 +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2316,28 +2316,28 @@ function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amou
|
|
|
2316
2316
|
}
|
|
2317
2317
|
case 2 /* Curve */: {
|
|
2318
2318
|
if (activeId < minBinId) {
|
|
2319
|
-
const
|
|
2320
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin,
|
|
2321
|
-
}
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2319
|
+
const weights = toWeightDecendingOrder(minBinId, maxBinId);
|
|
2320
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2321
|
+
} else if (activeId > maxBinId) {
|
|
2322
|
+
const weights = toWeightAscendingOrder(minBinId, maxBinId);
|
|
2323
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2324
|
+
} else {
|
|
2325
|
+
const weights = toWeightCurve(minBinId, maxBinId, activeId);
|
|
2326
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2325
2327
|
}
|
|
2326
|
-
const weights = toWeightCurve(minBinId, maxBinId, activeId);
|
|
2327
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2328
2328
|
break;
|
|
2329
2329
|
}
|
|
2330
2330
|
case 3 /* BidAsk */: {
|
|
2331
2331
|
if (activeId < minBinId) {
|
|
2332
|
-
const
|
|
2333
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin,
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2332
|
+
const weights = toWeightAscendingOrder(minBinId, maxBinId);
|
|
2333
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2334
|
+
} else if (activeId > maxBinId) {
|
|
2335
|
+
const weights = toWeightDecendingOrder(minBinId, maxBinId);
|
|
2336
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2337
|
+
} else {
|
|
2338
|
+
const weights = toWeightBidAsk(minBinId, maxBinId, activeId);
|
|
2339
|
+
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2338
2340
|
}
|
|
2339
|
-
const weights = toWeightBidAsk(minBinId, maxBinId, activeId);
|
|
2340
|
-
res = toAmountBothSide(activeId, binStep, amountX, amountY, amountXInActiveBin, amountYInActiveBin, weights);
|
|
2341
2341
|
break;
|
|
2342
2342
|
}
|
|
2343
2343
|
default:
|