@meteora-ag/dlmm 1.2.2-rc.0 → 1.2.2-rc.1
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 +24 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8925,8 +8925,21 @@ var DLMM = class {
|
|
|
8925
8925
|
}
|
|
8926
8926
|
async quoteCreatePosition({ strategy }) {
|
|
8927
8927
|
const { minBinId, maxBinId } = strategy;
|
|
8928
|
+
console.log(
|
|
8929
|
+
"\u{1F680} ~ DLMM ~ quoteCreatePosition ~ minBinId:",
|
|
8930
|
+
minBinId,
|
|
8931
|
+
maxBinId
|
|
8932
|
+
);
|
|
8928
8933
|
const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
|
|
8934
|
+
console.log(
|
|
8935
|
+
"\u{1F680} ~ DLMM ~ quoteCreatePosition ~ lowerBinArrayIndex:",
|
|
8936
|
+
lowerBinArrayIndex.toString()
|
|
8937
|
+
);
|
|
8929
8938
|
const upperBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId));
|
|
8939
|
+
console.log(
|
|
8940
|
+
"\u{1F680} ~ DLMM ~ quoteCreatePosition ~ upperBinArrayIndex:",
|
|
8941
|
+
upperBinArrayIndex.toString()
|
|
8942
|
+
);
|
|
8930
8943
|
const binArraysCount = (await this.binArraysToBeCreate(lowerBinArrayIndex, upperBinArrayIndex)).length;
|
|
8931
8944
|
const positionCount = Math.ceil((maxBinId - minBinId + 1) / MAX_BIN_PER_TX);
|
|
8932
8945
|
const binArrayCost = binArraysCount * BIN_ARRAY_FEE;
|
|
@@ -8994,6 +9007,8 @@ var DLMM = class {
|
|
|
8994
9007
|
slippage
|
|
8995
9008
|
}) {
|
|
8996
9009
|
const { maxBinId, minBinId } = strategy;
|
|
9010
|
+
console.log("\u{1F680} ~ DLMM ~ minBinId:", minBinId);
|
|
9011
|
+
console.log("\u{1F680} ~ DLMM ~ maxBinId:", maxBinId);
|
|
8997
9012
|
const maxActiveBinSlippage = slippage ? Math.ceil(slippage / (this.lbPair.binStep / 100)) : MAX_ACTIVE_BIN_SLIPPAGE;
|
|
8998
9013
|
const setComputeUnitLimitIx = computeBudgetIx();
|
|
8999
9014
|
const preInstructions = [setComputeUnitLimitIx];
|
|
@@ -9005,6 +9020,10 @@ var DLMM = class {
|
|
|
9005
9020
|
}).instruction();
|
|
9006
9021
|
preInstructions.push(initializePositionIx);
|
|
9007
9022
|
const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
|
|
9023
|
+
console.log(
|
|
9024
|
+
"\u{1F680} ~ DLMM ~ lowerBinArrayIndex:",
|
|
9025
|
+
lowerBinArrayIndex.toString()
|
|
9026
|
+
);
|
|
9008
9027
|
const [binArrayLower] = deriveBinArray(
|
|
9009
9028
|
this.pubkey,
|
|
9010
9029
|
lowerBinArrayIndex,
|
|
@@ -9014,6 +9033,10 @@ var DLMM = class {
|
|
|
9014
9033
|
lowerBinArrayIndex.add(new (0, _anchor.BN)(1)),
|
|
9015
9034
|
binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId))
|
|
9016
9035
|
);
|
|
9036
|
+
console.log(
|
|
9037
|
+
"\u{1F680} ~ DLMM ~ upperBinArrayIndex:",
|
|
9038
|
+
upperBinArrayIndex.toString()
|
|
9039
|
+
);
|
|
9017
9040
|
const [binArrayUpper] = deriveBinArray(
|
|
9018
9041
|
this.pubkey,
|
|
9019
9042
|
upperBinArrayIndex,
|
|
@@ -11592,7 +11615,7 @@ var DLMM = class {
|
|
|
11592
11615
|
[binArray.toBase58()]: binArrayAccounts[index]
|
|
11593
11616
|
}))
|
|
11594
11617
|
);
|
|
11595
|
-
return binArrayAccounts.filter((binArray) => binArray === null);
|
|
11618
|
+
return binArrayAccounts.filter((binArray) => binArray === null).map((_, index) => binArrays[index]);
|
|
11596
11619
|
}
|
|
11597
11620
|
async createBinArraysIfNeeded(upperBinArrayIndex, lowerBinArrayIndex, funder) {
|
|
11598
11621
|
const ixs = [];
|