@crypticdot/defituna-client 2.0.10 → 2.0.11
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 +54 -72
- package/dist/index.mjs +72 -93
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -7402,30 +7402,24 @@ async function addLiquidityOrcaInstructions(rpc, authority, positionMint, args,
|
|
|
7402
7402
|
whirlpool.data.tickSpacing
|
|
7403
7403
|
);
|
|
7404
7404
|
const [upperTickArrayAddress] = await (0, import_whirlpools_client2.getTickArrayAddress)(whirlpool.address, upperTickArrayStartIndex);
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
funder: authority,
|
|
7424
|
-
tickArray: upperTickArrayAddress,
|
|
7425
|
-
startTickIndex: upperTickArrayStartIndex
|
|
7426
|
-
})
|
|
7427
|
-
);
|
|
7428
|
-
}
|
|
7405
|
+
instructions.push(
|
|
7406
|
+
(0, import_whirlpools_client2.getInitializeDynamicTickArrayInstruction)({
|
|
7407
|
+
whirlpool: whirlpool.address,
|
|
7408
|
+
funder: authority,
|
|
7409
|
+
tickArray: lowerTickArrayAddress,
|
|
7410
|
+
startTickIndex: lowerTickArrayStartIndex,
|
|
7411
|
+
idempotent: true
|
|
7412
|
+
})
|
|
7413
|
+
);
|
|
7414
|
+
instructions.push(
|
|
7415
|
+
(0, import_whirlpools_client2.getInitializeDynamicTickArrayInstruction)({
|
|
7416
|
+
whirlpool: whirlpool.address,
|
|
7417
|
+
funder: authority,
|
|
7418
|
+
tickArray: upperTickArrayAddress,
|
|
7419
|
+
startTickIndex: upperTickArrayStartIndex,
|
|
7420
|
+
idempotent: true
|
|
7421
|
+
})
|
|
7422
|
+
);
|
|
7429
7423
|
const ix = await addLiquidityOrcaInstruction(
|
|
7430
7424
|
authority,
|
|
7431
7425
|
tunaPosition,
|
|
@@ -9202,30 +9196,24 @@ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positio
|
|
|
9202
9196
|
const [lowerTickArrayAddress] = await (0, import_whirlpools_client9.getTickArrayAddress)(whirlpool.address, lowerTickArrayIndex);
|
|
9203
9197
|
const upperTickArrayIndex = (0, import_whirlpools_core4.getTickArrayStartTickIndex)(args.tickUpperIndex, whirlpool.data.tickSpacing);
|
|
9204
9198
|
const [upperTickArrayAddress] = await (0, import_whirlpools_client9.getTickArrayAddress)(whirlpool.address, upperTickArrayIndex);
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
funder: authority,
|
|
9224
|
-
tickArray: upperTickArrayAddress,
|
|
9225
|
-
startTickIndex: upperTickArrayIndex
|
|
9226
|
-
})
|
|
9227
|
-
);
|
|
9228
|
-
}
|
|
9199
|
+
instructions.push(
|
|
9200
|
+
(0, import_whirlpools_client9.getInitializeDynamicTickArrayInstruction)({
|
|
9201
|
+
whirlpool: whirlpool.address,
|
|
9202
|
+
funder: authority,
|
|
9203
|
+
tickArray: lowerTickArrayAddress,
|
|
9204
|
+
startTickIndex: lowerTickArrayIndex,
|
|
9205
|
+
idempotent: true
|
|
9206
|
+
})
|
|
9207
|
+
);
|
|
9208
|
+
instructions.push(
|
|
9209
|
+
(0, import_whirlpools_client9.getInitializeDynamicTickArrayInstruction)({
|
|
9210
|
+
whirlpool: whirlpool.address,
|
|
9211
|
+
funder: authority,
|
|
9212
|
+
tickArray: upperTickArrayAddress,
|
|
9213
|
+
startTickIndex: upperTickArrayIndex,
|
|
9214
|
+
idempotent: true
|
|
9215
|
+
})
|
|
9216
|
+
);
|
|
9229
9217
|
const ix = await openPositionWithLiquidityOrcaInstruction(
|
|
9230
9218
|
authority,
|
|
9231
9219
|
positionMint,
|
|
@@ -10266,30 +10254,24 @@ async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, c
|
|
|
10266
10254
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
10267
10255
|
const internalCleanupInstructions = [];
|
|
10268
10256
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
funder: authority,
|
|
10288
|
-
tickArray: secondaryTickArrays.upperTickArrayAddress,
|
|
10289
|
-
startTickIndex: secondaryTickArrays.upperTickArrayStartIndex
|
|
10290
|
-
})
|
|
10291
|
-
);
|
|
10292
|
-
}
|
|
10257
|
+
instructions.push(
|
|
10258
|
+
(0, import_whirlpools_client12.getInitializeDynamicTickArrayInstruction)({
|
|
10259
|
+
whirlpool: whirlpool.address,
|
|
10260
|
+
funder: authority,
|
|
10261
|
+
tickArray: secondaryTickArrays.lowerTickArrayAddress,
|
|
10262
|
+
startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex,
|
|
10263
|
+
idempotent: true
|
|
10264
|
+
})
|
|
10265
|
+
);
|
|
10266
|
+
instructions.push(
|
|
10267
|
+
(0, import_whirlpools_client12.getInitializeDynamicTickArrayInstruction)({
|
|
10268
|
+
whirlpool: whirlpool.address,
|
|
10269
|
+
funder: authority,
|
|
10270
|
+
tickArray: secondaryTickArrays.upperTickArrayAddress,
|
|
10271
|
+
startTickIndex: secondaryTickArrays.upperTickArrayStartIndex,
|
|
10272
|
+
idempotent: true
|
|
10273
|
+
})
|
|
10274
|
+
);
|
|
10293
10275
|
const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
|
|
10294
10276
|
rpc,
|
|
10295
10277
|
authority,
|
package/dist/index.mjs
CHANGED
|
@@ -7418,9 +7418,8 @@ function calculateProtocolFee(collateralAmount, borrowAmount, protocolFeeRateOnC
|
|
|
7418
7418
|
|
|
7419
7419
|
// src/txbuilder/addLiquidityOrca.ts
|
|
7420
7420
|
import {
|
|
7421
|
-
fetchAllMaybeTickArray,
|
|
7422
7421
|
fetchMaybeWhirlpool,
|
|
7423
|
-
|
|
7422
|
+
getInitializeDynamicTickArrayInstruction,
|
|
7424
7423
|
getOracleAddress,
|
|
7425
7424
|
getPositionAddress,
|
|
7426
7425
|
getTickArrayAddress as getTickArrayAddress3,
|
|
@@ -7512,30 +7511,24 @@ async function addLiquidityOrcaInstructions(rpc, authority, positionMint, args,
|
|
|
7512
7511
|
whirlpool.data.tickSpacing
|
|
7513
7512
|
);
|
|
7514
7513
|
const [upperTickArrayAddress] = await getTickArrayAddress3(whirlpool.address, upperTickArrayStartIndex);
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
funder: authority,
|
|
7534
|
-
tickArray: upperTickArrayAddress,
|
|
7535
|
-
startTickIndex: upperTickArrayStartIndex
|
|
7536
|
-
})
|
|
7537
|
-
);
|
|
7538
|
-
}
|
|
7514
|
+
instructions.push(
|
|
7515
|
+
getInitializeDynamicTickArrayInstruction({
|
|
7516
|
+
whirlpool: whirlpool.address,
|
|
7517
|
+
funder: authority,
|
|
7518
|
+
tickArray: lowerTickArrayAddress,
|
|
7519
|
+
startTickIndex: lowerTickArrayStartIndex,
|
|
7520
|
+
idempotent: true
|
|
7521
|
+
})
|
|
7522
|
+
);
|
|
7523
|
+
instructions.push(
|
|
7524
|
+
getInitializeDynamicTickArrayInstruction({
|
|
7525
|
+
whirlpool: whirlpool.address,
|
|
7526
|
+
funder: authority,
|
|
7527
|
+
tickArray: upperTickArrayAddress,
|
|
7528
|
+
startTickIndex: upperTickArrayStartIndex,
|
|
7529
|
+
idempotent: true
|
|
7530
|
+
})
|
|
7531
|
+
);
|
|
7539
7532
|
const ix = await addLiquidityOrcaInstruction(
|
|
7540
7533
|
authority,
|
|
7541
7534
|
tunaPosition,
|
|
@@ -7671,10 +7664,10 @@ async function addLiquidityOrcaInstruction(authority, tunaPosition, tunaConfig,
|
|
|
7671
7664
|
|
|
7672
7665
|
// src/txbuilder/addLiquidityFusion.ts
|
|
7673
7666
|
import {
|
|
7674
|
-
fetchAllMaybeTickArray
|
|
7667
|
+
fetchAllMaybeTickArray,
|
|
7675
7668
|
fetchMaybeFusionPool,
|
|
7676
7669
|
FUSIONAMM_PROGRAM_ADDRESS,
|
|
7677
|
-
getInitializeTickArrayInstruction
|
|
7670
|
+
getInitializeTickArrayInstruction,
|
|
7678
7671
|
getPositionAddress as getPositionAddress2,
|
|
7679
7672
|
getTickArrayAddress as getTickArrayAddress4
|
|
7680
7673
|
} from "@crypticdot/fusionamm-client";
|
|
@@ -7764,13 +7757,13 @@ async function addLiquidityFusionInstructions(rpc, authority, positionMint, args
|
|
|
7764
7757
|
fusionPool.data.tickSpacing
|
|
7765
7758
|
);
|
|
7766
7759
|
const [upperTickArrayAddress] = await getTickArrayAddress4(fusionPool.address, upperTickArrayStartIndex);
|
|
7767
|
-
const [lowerTickArray, upperTickArray] = await
|
|
7760
|
+
const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray(rpc, [
|
|
7768
7761
|
lowerTickArrayAddress,
|
|
7769
7762
|
upperTickArrayAddress
|
|
7770
7763
|
]);
|
|
7771
7764
|
if (!lowerTickArray.exists) {
|
|
7772
7765
|
instructions.push(
|
|
7773
|
-
|
|
7766
|
+
getInitializeTickArrayInstruction({
|
|
7774
7767
|
fusionPool: fusionPool.address,
|
|
7775
7768
|
funder: authority,
|
|
7776
7769
|
tickArray: lowerTickArrayAddress,
|
|
@@ -7780,7 +7773,7 @@ async function addLiquidityFusionInstructions(rpc, authority, positionMint, args
|
|
|
7780
7773
|
}
|
|
7781
7774
|
if (!upperTickArray.exists && lowerTickArrayStartIndex !== upperTickArrayStartIndex) {
|
|
7782
7775
|
instructions.push(
|
|
7783
|
-
|
|
7776
|
+
getInitializeTickArrayInstruction({
|
|
7784
7777
|
fusionPool: fusionPool.address,
|
|
7785
7778
|
funder: authority,
|
|
7786
7779
|
tickArray: upperTickArrayAddress,
|
|
@@ -9318,9 +9311,8 @@ async function openPositionFusionInstruction(rpc, authority, positionMint, fusio
|
|
|
9318
9311
|
|
|
9319
9312
|
// src/txbuilder/openPositionWithLiquidityOrca.ts
|
|
9320
9313
|
import {
|
|
9321
|
-
fetchAllMaybeTickArray as fetchAllMaybeTickArray3,
|
|
9322
9314
|
fetchMaybeWhirlpool as fetchMaybeWhirlpool7,
|
|
9323
|
-
|
|
9315
|
+
getInitializeDynamicTickArrayInstruction as getInitializeDynamicTickArrayInstruction2,
|
|
9324
9316
|
getOracleAddress as getOracleAddress4,
|
|
9325
9317
|
getPositionAddress as getPositionAddress15,
|
|
9326
9318
|
getTickArrayAddress as getTickArrayAddress6,
|
|
@@ -9405,30 +9397,24 @@ async function openPositionWithLiquidityOrcaInstructions(rpc, authority, positio
|
|
|
9405
9397
|
const [lowerTickArrayAddress] = await getTickArrayAddress6(whirlpool.address, lowerTickArrayIndex);
|
|
9406
9398
|
const upperTickArrayIndex = getTickArrayStartTickIndex6(args.tickUpperIndex, whirlpool.data.tickSpacing);
|
|
9407
9399
|
const [upperTickArrayAddress] = await getTickArrayAddress6(whirlpool.address, upperTickArrayIndex);
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
funder: authority,
|
|
9427
|
-
tickArray: upperTickArrayAddress,
|
|
9428
|
-
startTickIndex: upperTickArrayIndex
|
|
9429
|
-
})
|
|
9430
|
-
);
|
|
9431
|
-
}
|
|
9400
|
+
instructions.push(
|
|
9401
|
+
getInitializeDynamicTickArrayInstruction2({
|
|
9402
|
+
whirlpool: whirlpool.address,
|
|
9403
|
+
funder: authority,
|
|
9404
|
+
tickArray: lowerTickArrayAddress,
|
|
9405
|
+
startTickIndex: lowerTickArrayIndex,
|
|
9406
|
+
idempotent: true
|
|
9407
|
+
})
|
|
9408
|
+
);
|
|
9409
|
+
instructions.push(
|
|
9410
|
+
getInitializeDynamicTickArrayInstruction2({
|
|
9411
|
+
whirlpool: whirlpool.address,
|
|
9412
|
+
funder: authority,
|
|
9413
|
+
tickArray: upperTickArrayAddress,
|
|
9414
|
+
startTickIndex: upperTickArrayIndex,
|
|
9415
|
+
idempotent: true
|
|
9416
|
+
})
|
|
9417
|
+
);
|
|
9432
9418
|
const ix = await openPositionWithLiquidityOrcaInstruction(
|
|
9433
9419
|
authority,
|
|
9434
9420
|
positionMint,
|
|
@@ -9561,11 +9547,11 @@ async function openPositionWithLiquidityOrcaInstruction(authority, positionMint,
|
|
|
9561
9547
|
|
|
9562
9548
|
// src/txbuilder/openPositionWithLiquidityFusion.ts
|
|
9563
9549
|
import {
|
|
9564
|
-
fetchAllMaybeTickArray as
|
|
9550
|
+
fetchAllMaybeTickArray as fetchAllMaybeTickArray2,
|
|
9565
9551
|
fetchMaybeFusionPool as fetchMaybeFusionPool7,
|
|
9566
9552
|
FP_NFT_UPDATE_AUTH as FP_NFT_UPDATE_AUTH2,
|
|
9567
9553
|
FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS8,
|
|
9568
|
-
getInitializeTickArrayInstruction as
|
|
9554
|
+
getInitializeTickArrayInstruction as getInitializeTickArrayInstruction2,
|
|
9569
9555
|
getPositionAddress as getPositionAddress16,
|
|
9570
9556
|
getTickArrayAddress as getTickArrayAddress7
|
|
9571
9557
|
} from "@crypticdot/fusionamm-client";
|
|
@@ -9648,13 +9634,13 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
|
|
|
9648
9634
|
const [lowerTickArrayAddress] = await getTickArrayAddress7(fusionPool.address, lowerTickArrayIndex);
|
|
9649
9635
|
const upperTickArrayIndex = getTickArrayStartTickIndex7(args.tickUpperIndex, fusionPool.data.tickSpacing);
|
|
9650
9636
|
const [upperTickArrayAddress] = await getTickArrayAddress7(fusionPool.address, upperTickArrayIndex);
|
|
9651
|
-
const [lowerTickArray, upperTickArray] = await
|
|
9637
|
+
const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray2(rpc, [
|
|
9652
9638
|
lowerTickArrayAddress,
|
|
9653
9639
|
upperTickArrayAddress
|
|
9654
9640
|
]);
|
|
9655
9641
|
if (!lowerTickArray.exists) {
|
|
9656
9642
|
instructions.push(
|
|
9657
|
-
|
|
9643
|
+
getInitializeTickArrayInstruction2({
|
|
9658
9644
|
fusionPool: fusionPool.address,
|
|
9659
9645
|
funder: authority,
|
|
9660
9646
|
tickArray: lowerTickArrayAddress,
|
|
@@ -9664,7 +9650,7 @@ async function openPositionWithLiquidityFusionInstructions(rpc, authority, posit
|
|
|
9664
9650
|
}
|
|
9665
9651
|
if (!upperTickArray.exists && lowerTickArrayIndex !== upperTickArrayIndex) {
|
|
9666
9652
|
instructions.push(
|
|
9667
|
-
|
|
9653
|
+
getInitializeTickArrayInstruction2({
|
|
9668
9654
|
fusionPool: fusionPool.address,
|
|
9669
9655
|
funder: authority,
|
|
9670
9656
|
tickArray: upperTickArrayAddress,
|
|
@@ -10494,9 +10480,8 @@ async function repayDebtInstruction(authority, positionMint, mintA, mintB, marke
|
|
|
10494
10480
|
|
|
10495
10481
|
// src/txbuilder/rebalancePositionOrca.ts
|
|
10496
10482
|
import {
|
|
10497
|
-
fetchAllMaybeTickArray as fetchAllMaybeTickArray5,
|
|
10498
10483
|
fetchMaybeWhirlpool as fetchMaybeWhirlpool9,
|
|
10499
|
-
|
|
10484
|
+
getInitializeDynamicTickArrayInstruction as getInitializeDynamicTickArrayInstruction3,
|
|
10500
10485
|
getOracleAddress as getOracleAddress7,
|
|
10501
10486
|
getPositionAddress as getPositionAddress19,
|
|
10502
10487
|
WHIRLPOOL_PROGRAM_ADDRESS as WHIRLPOOL_PROGRAM_ADDRESS11
|
|
@@ -10529,30 +10514,24 @@ async function rebalancePositionOrcaInstructions(rpc, authority, positionMint, c
|
|
|
10529
10514
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
10530
10515
|
const internalCleanupInstructions = [];
|
|
10531
10516
|
const secondaryTickArrays = await OrcaUtils.getTickArraysForRebalancedPosition(whirlpool, tunaPosition);
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
funder: authority,
|
|
10551
|
-
tickArray: secondaryTickArrays.upperTickArrayAddress,
|
|
10552
|
-
startTickIndex: secondaryTickArrays.upperTickArrayStartIndex
|
|
10553
|
-
})
|
|
10554
|
-
);
|
|
10555
|
-
}
|
|
10517
|
+
instructions.push(
|
|
10518
|
+
getInitializeDynamicTickArrayInstruction3({
|
|
10519
|
+
whirlpool: whirlpool.address,
|
|
10520
|
+
funder: authority,
|
|
10521
|
+
tickArray: secondaryTickArrays.lowerTickArrayAddress,
|
|
10522
|
+
startTickIndex: secondaryTickArrays.lowerTickArrayStartIndex,
|
|
10523
|
+
idempotent: true
|
|
10524
|
+
})
|
|
10525
|
+
);
|
|
10526
|
+
instructions.push(
|
|
10527
|
+
getInitializeDynamicTickArrayInstruction3({
|
|
10528
|
+
whirlpool: whirlpool.address,
|
|
10529
|
+
funder: authority,
|
|
10530
|
+
tickArray: secondaryTickArrays.upperTickArrayAddress,
|
|
10531
|
+
startTickIndex: secondaryTickArrays.upperTickArrayStartIndex,
|
|
10532
|
+
idempotent: true
|
|
10533
|
+
})
|
|
10534
|
+
);
|
|
10556
10535
|
const createFeeRecipientAtaAInstructions = await getCreateAtaInstructions(
|
|
10557
10536
|
rpc,
|
|
10558
10537
|
authority,
|
|
@@ -10681,10 +10660,10 @@ async function rebalancePositionOrcaInstruction(authority, tunaPosition, tunaCon
|
|
|
10681
10660
|
|
|
10682
10661
|
// src/txbuilder/rebalancePositionFusion.ts
|
|
10683
10662
|
import {
|
|
10684
|
-
fetchAllMaybeTickArray as
|
|
10663
|
+
fetchAllMaybeTickArray as fetchAllMaybeTickArray3,
|
|
10685
10664
|
fetchMaybeFusionPool as fetchMaybeFusionPool9,
|
|
10686
10665
|
FUSIONAMM_PROGRAM_ADDRESS as FUSIONAMM_PROGRAM_ADDRESS11,
|
|
10687
|
-
getInitializeTickArrayInstruction as
|
|
10666
|
+
getInitializeTickArrayInstruction as getInitializeTickArrayInstruction3,
|
|
10688
10667
|
getPositionAddress as getPositionAddress20
|
|
10689
10668
|
} from "@crypticdot/fusionamm-client";
|
|
10690
10669
|
import {
|
|
@@ -10714,13 +10693,13 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
|
|
|
10714
10693
|
if (!createInstructions) createInstructions = instructions;
|
|
10715
10694
|
if (!cleanupInstructions) cleanupInstructions = instructions;
|
|
10716
10695
|
const secondaryTickArrays = await FusionUtils.getTickArraysForRebalancedPosition(fusionPool, tunaPosition);
|
|
10717
|
-
const [lowerTickArray, upperTickArray] = await
|
|
10696
|
+
const [lowerTickArray, upperTickArray] = await fetchAllMaybeTickArray3(rpc, [
|
|
10718
10697
|
secondaryTickArrays.lowerTickArrayAddress,
|
|
10719
10698
|
secondaryTickArrays.upperTickArrayAddress
|
|
10720
10699
|
]);
|
|
10721
10700
|
if (!lowerTickArray.exists) {
|
|
10722
10701
|
instructions.push(
|
|
10723
|
-
|
|
10702
|
+
getInitializeTickArrayInstruction3({
|
|
10724
10703
|
fusionPool: fusionPool.address,
|
|
10725
10704
|
funder: authority,
|
|
10726
10705
|
tickArray: secondaryTickArrays.lowerTickArrayAddress,
|
|
@@ -10730,7 +10709,7 @@ async function rebalancePositionFusionInstructions(rpc, authority, positionMint,
|
|
|
10730
10709
|
}
|
|
10731
10710
|
if (!upperTickArray.exists && secondaryTickArrays.lowerTickArrayStartIndex !== secondaryTickArrays.upperTickArrayStartIndex) {
|
|
10732
10711
|
instructions.push(
|
|
10733
|
-
|
|
10712
|
+
getInitializeTickArrayInstruction3({
|
|
10734
10713
|
fusionPool: fusionPool.address,
|
|
10735
10714
|
funder: authority,
|
|
10736
10715
|
tickArray: secondaryTickArrays.upperTickArrayAddress,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crypticdot/defituna-client",
|
|
3
3
|
"description": "Typescript client to interact with DefiTuna's on-chain program.",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.11",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@orca-so/whirlpools-core": "^2.0.0",
|
|
20
|
-
"@orca-so/whirlpools-client": "^
|
|
21
|
-
"@orca-so/whirlpools": "^
|
|
22
|
-
"@crypticdot/fusionamm-core": "^1.0.
|
|
23
|
-
"@crypticdot/fusionamm-client": "^1.0.
|
|
24
|
-
"@crypticdot/fusionamm-sdk": "^1.0.
|
|
20
|
+
"@orca-so/whirlpools-client": "^3.0.0",
|
|
21
|
+
"@orca-so/whirlpools": "^3.0.0",
|
|
22
|
+
"@crypticdot/fusionamm-core": "^1.0.53",
|
|
23
|
+
"@crypticdot/fusionamm-client": "^1.0.53",
|
|
24
|
+
"@crypticdot/fusionamm-sdk": "^1.0.53",
|
|
25
25
|
"@solana/kit": "^2.1.0",
|
|
26
26
|
"@solana-program/compute-budget": "^0.7.0",
|
|
27
27
|
"@solana-program/system": "^0.7.0",
|