@meteora-ag/dlmm 1.6.0-rc.31 → 1.6.0-rc.32
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 +15 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12939,6 +12939,9 @@ function buildLiquidityStrategyParameters(amountX, amountY, minDeltaId, maxDelta
|
|
|
12939
12939
|
};
|
|
12940
12940
|
}
|
|
12941
12941
|
|
|
12942
|
+
// src/dlmm/helpers/index.ts
|
|
12943
|
+
|
|
12944
|
+
|
|
12942
12945
|
// src/dlmm/helpers/lbPair.ts
|
|
12943
12946
|
|
|
12944
12947
|
|
|
@@ -13668,10 +13671,20 @@ function getBinCount(minBinId, maxBinId) {
|
|
|
13668
13671
|
return maxBinId - minBinId + 1;
|
|
13669
13672
|
}
|
|
13670
13673
|
function getSlippageMaxAmount(amount, slippage) {
|
|
13671
|
-
|
|
13674
|
+
if (slippage == 100) {
|
|
13675
|
+
return U64_MAX;
|
|
13676
|
+
}
|
|
13677
|
+
const amountDecimal = new (0, _decimaljs2.default)(amount.toString());
|
|
13678
|
+
const slippageAppliedAmount = new (0, _anchor.BN)(
|
|
13679
|
+
amountDecimal.mul(new (0, _decimaljs2.default)(100 + slippage)).div(new (0, _decimaljs2.default)(100)).floor().toString()
|
|
13680
|
+
);
|
|
13681
|
+
return slippageAppliedAmount;
|
|
13672
13682
|
}
|
|
13673
13683
|
function getSlippageMinAmount(amount, slippage) {
|
|
13674
|
-
|
|
13684
|
+
const amountDecimal = new (0, _decimaljs2.default)(amount.toString());
|
|
13685
|
+
return new (0, _anchor.BN)(
|
|
13686
|
+
amountDecimal.mul(new (0, _decimaljs2.default)(100 - slippage)).div(new (0, _decimaljs2.default)(100)).ceil().toString()
|
|
13687
|
+
);
|
|
13675
13688
|
}
|
|
13676
13689
|
function getPositionCountByBinCount(binCount) {
|
|
13677
13690
|
return Math.ceil(binCount / MAX_BINS_PER_POSITION.toNumber());
|