@meteora-ag/dlmm 1.5.0-sam.5 → 1.5.0
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 +2 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9390,12 +9390,9 @@ function toWeightBidAsk(minBinId, maxBinId, activeId) {
|
|
|
9390
9390
|
return distributions;
|
|
9391
9391
|
}
|
|
9392
9392
|
function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amountX, amountY, amountXInActiveBin, amountYInActiveBin, strategyType, mintX, mintY, clock) {
|
|
9393
|
-
console.log("SDK", strategyType, activeId, minBinId, maxBinId);
|
|
9394
9393
|
const isSingleSideX = amountY.isZero();
|
|
9395
|
-
console.log("\u{1F680} ~ isSingleSideX:", isSingleSideX);
|
|
9396
9394
|
switch (strategyType) {
|
|
9397
9395
|
case 0 /* Spot */: {
|
|
9398
|
-
console.log("test0", activeId < minBinId || activeId > maxBinId);
|
|
9399
9396
|
if (activeId < minBinId || activeId > maxBinId) {
|
|
9400
9397
|
const weights = toWeightSpotBalanced(minBinId, maxBinId);
|
|
9401
9398
|
return toAmountBothSide(
|
|
@@ -9413,10 +9410,8 @@ function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amou
|
|
|
9413
9410
|
}
|
|
9414
9411
|
const amountsInBin = [];
|
|
9415
9412
|
if (!isSingleSideX) {
|
|
9416
|
-
console.log("test", minBinId <= activeId);
|
|
9417
9413
|
if (minBinId <= activeId) {
|
|
9418
9414
|
const weights = toWeightSpotBalanced(minBinId, activeId);
|
|
9419
|
-
console.log("\u{1F680} ~ weights:", weights);
|
|
9420
9415
|
const amounts = toAmountBidSide(
|
|
9421
9416
|
activeId,
|
|
9422
9417
|
amountY,
|
|
@@ -9424,7 +9419,6 @@ function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amou
|
|
|
9424
9419
|
mintY,
|
|
9425
9420
|
clock
|
|
9426
9421
|
);
|
|
9427
|
-
console.log("\u{1F680} ~ amounts:", amounts);
|
|
9428
9422
|
for (let bin of amounts) {
|
|
9429
9423
|
amountsInBin.push({
|
|
9430
9424
|
binId: bin.binId,
|
|
@@ -9433,10 +9427,8 @@ function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amou
|
|
|
9433
9427
|
});
|
|
9434
9428
|
}
|
|
9435
9429
|
}
|
|
9436
|
-
console.log("test2", activeId < maxBinId);
|
|
9437
9430
|
if (activeId < maxBinId) {
|
|
9438
9431
|
const weights = toWeightSpotBalanced(activeId + 1, maxBinId);
|
|
9439
|
-
console.log("\u{1F680} ~ weights:", weights);
|
|
9440
9432
|
const amounts = toAmountAskSide(
|
|
9441
9433
|
activeId,
|
|
9442
9434
|
binStep,
|
|
@@ -9445,7 +9437,6 @@ function toAmountsBothSideByStrategy(activeId, binStep, minBinId, maxBinId, amou
|
|
|
9445
9437
|
mintX,
|
|
9446
9438
|
clock
|
|
9447
9439
|
);
|
|
9448
|
-
console.log("\u{1F680} ~ amounts:", amounts);
|
|
9449
9440
|
for (let bin of amounts) {
|
|
9450
9441
|
amountsInBin.push({
|
|
9451
9442
|
binId: bin.binId,
|
|
@@ -11354,9 +11345,7 @@ var DLMM = class {
|
|
|
11354
11345
|
tokenBadgeX,
|
|
11355
11346
|
tokenBadgeY
|
|
11356
11347
|
]);
|
|
11357
|
-
const presetParameterState = await program.account.presetParameter2.fetch(
|
|
11358
|
-
presetParameter
|
|
11359
|
-
);
|
|
11348
|
+
const presetParameterState = await program.account.presetParameter2.fetch(presetParameter);
|
|
11360
11349
|
const existsPool = await this.getPairPubkeyIfExists(
|
|
11361
11350
|
connection,
|
|
11362
11351
|
tokenX,
|
|
@@ -12556,9 +12545,7 @@ var DLMM = class {
|
|
|
12556
12545
|
slippage
|
|
12557
12546
|
}) {
|
|
12558
12547
|
const maxActiveBinSlippage = slippage ? Math.ceil(slippage / (this.lbPair.binStep / 100)) : MAX_ACTIVE_BIN_SLIPPAGE;
|
|
12559
|
-
const positionAccount = await this.program.account.positionV2.fetch(
|
|
12560
|
-
positionPubKey
|
|
12561
|
-
);
|
|
12548
|
+
const positionAccount = await this.program.account.positionV2.fetch(positionPubKey);
|
|
12562
12549
|
const { lowerBinId, upperBinId, binIds } = this.processXYAmountDistribution(xYAmountDistribution);
|
|
12563
12550
|
if (lowerBinId < positionAccount.lowerBinId)
|
|
12564
12551
|
throw new Error(
|