@meteora-ag/dlmm 1.2.2-rc.1 → 1.2.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 +3 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8925,20 +8925,10 @@ 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
|
-
);
|
|
8933
8928
|
const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
lowerBinArrayIndex.
|
|
8937
|
-
);
|
|
8938
|
-
const upperBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId));
|
|
8939
|
-
console.log(
|
|
8940
|
-
"\u{1F680} ~ DLMM ~ quoteCreatePosition ~ upperBinArrayIndex:",
|
|
8941
|
-
upperBinArrayIndex.toString()
|
|
8929
|
+
const upperBinArrayIndex = _anchor.BN.max(
|
|
8930
|
+
binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId)),
|
|
8931
|
+
lowerBinArrayIndex.add(new (0, _anchor.BN)(1))
|
|
8942
8932
|
);
|
|
8943
8933
|
const binArraysCount = (await this.binArraysToBeCreate(lowerBinArrayIndex, upperBinArrayIndex)).length;
|
|
8944
8934
|
const positionCount = Math.ceil((maxBinId - minBinId + 1) / MAX_BIN_PER_TX);
|
|
@@ -9007,8 +8997,6 @@ var DLMM = class {
|
|
|
9007
8997
|
slippage
|
|
9008
8998
|
}) {
|
|
9009
8999
|
const { maxBinId, minBinId } = strategy;
|
|
9010
|
-
console.log("\u{1F680} ~ DLMM ~ minBinId:", minBinId);
|
|
9011
|
-
console.log("\u{1F680} ~ DLMM ~ maxBinId:", maxBinId);
|
|
9012
9000
|
const maxActiveBinSlippage = slippage ? Math.ceil(slippage / (this.lbPair.binStep / 100)) : MAX_ACTIVE_BIN_SLIPPAGE;
|
|
9013
9001
|
const setComputeUnitLimitIx = computeBudgetIx();
|
|
9014
9002
|
const preInstructions = [setComputeUnitLimitIx];
|
|
@@ -9020,10 +9008,6 @@ var DLMM = class {
|
|
|
9020
9008
|
}).instruction();
|
|
9021
9009
|
preInstructions.push(initializePositionIx);
|
|
9022
9010
|
const lowerBinArrayIndex = binIdToBinArrayIndex(new (0, _anchor.BN)(minBinId));
|
|
9023
|
-
console.log(
|
|
9024
|
-
"\u{1F680} ~ DLMM ~ lowerBinArrayIndex:",
|
|
9025
|
-
lowerBinArrayIndex.toString()
|
|
9026
|
-
);
|
|
9027
9011
|
const [binArrayLower] = deriveBinArray(
|
|
9028
9012
|
this.pubkey,
|
|
9029
9013
|
lowerBinArrayIndex,
|
|
@@ -9033,10 +9017,6 @@ var DLMM = class {
|
|
|
9033
9017
|
lowerBinArrayIndex.add(new (0, _anchor.BN)(1)),
|
|
9034
9018
|
binIdToBinArrayIndex(new (0, _anchor.BN)(maxBinId))
|
|
9035
9019
|
);
|
|
9036
|
-
console.log(
|
|
9037
|
-
"\u{1F680} ~ DLMM ~ upperBinArrayIndex:",
|
|
9038
|
-
upperBinArrayIndex.toString()
|
|
9039
|
-
);
|
|
9040
9020
|
const [binArrayUpper] = deriveBinArray(
|
|
9041
9021
|
this.pubkey,
|
|
9042
9022
|
upperBinArrayIndex,
|
|
@@ -11610,11 +11590,6 @@ var DLMM = class {
|
|
|
11610
11590
|
binArrays.push(binArrayPubKey);
|
|
11611
11591
|
}
|
|
11612
11592
|
const binArrayAccounts = await this.program.provider.connection.getMultipleAccountsInfo(binArrays);
|
|
11613
|
-
console.log(
|
|
11614
|
-
binArrays.map((binArray, index) => ({
|
|
11615
|
-
[binArray.toBase58()]: binArrayAccounts[index]
|
|
11616
|
-
}))
|
|
11617
|
-
);
|
|
11618
11593
|
return binArrayAccounts.filter((binArray) => binArray === null).map((_, index) => binArrays[index]);
|
|
11619
11594
|
}
|
|
11620
11595
|
async createBinArraysIfNeeded(upperBinArrayIndex, lowerBinArrayIndex, funder) {
|