You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -91,20 +92,15 @@ export type IncreaseLiquidityInstructions = {
91
92
/** The quote object with details about the increase in liquidity, including the liquidity delta, estimated tokens, and maximum token amounts based on slippage tolerance. */
92
93
quote: IncreaseLiquidityQuote;
93
94
94
-
/** The initialization cost for liquidity in lamports. */
95
-
initializationCost: Lamports;
96
-
97
-
/** The mint address of the position NFT. */
98
-
positionMint: Address;
99
-
100
95
/** List of Solana transaction instructions to execute. */
101
96
instructions: IInstruction[];
102
97
};
103
98
104
99
functiongetIncreaseLiquidityQuote(
105
100
param: IncreaseLiquidityQuoteParam,
106
101
pool: Whirlpool,
107
-
tickRange: TickRange,
102
+
tickLowerIndex: number,
103
+
tickUpperIndex: number,
108
104
slippageToleranceBps: number,
109
105
transferFeeA: TransferFee|undefined,
110
106
transferFeeB: TransferFee|undefined,
@@ -114,8 +110,8 @@ function getIncreaseLiquidityQuote(
114
110
param.liquidity,
115
111
slippageToleranceBps,
116
112
pool.sqrtPrice,
117
-
tickRange.tickLowerIndex,
118
-
tickRange.tickUpperIndex,
113
+
tickLowerIndex,
114
+
tickUpperIndex,
119
115
transferFeeA,
120
116
transferFeeB,
121
117
);
@@ -124,8 +120,8 @@ function getIncreaseLiquidityQuote(
124
120
param.tokenA,
125
121
slippageToleranceBps,
126
122
pool.sqrtPrice,
127
-
tickRange.tickLowerIndex,
128
-
tickRange.tickUpperIndex,
123
+
tickLowerIndex,
124
+
tickUpperIndex,
129
125
transferFeeA,
130
126
transferFeeB,
131
127
);
@@ -134,8 +130,8 @@ function getIncreaseLiquidityQuote(
134
130
param.tokenB,
135
131
slippageToleranceBps,
136
132
pool.sqrtPrice,
137
-
tickRange.tickLowerIndex,
138
-
tickRange.tickUpperIndex,
133
+
tickLowerIndex,
134
+
tickUpperIndex,
139
135
transferFeeA,
140
136
transferFeeB,
141
137
);
@@ -206,7 +202,8 @@ export async function increaseLiquidityInstructions(
206
202
constquote=getIncreaseLiquidityQuote(
207
203
param,
208
204
whirlpool.data,
209
-
position.data,
205
+
position.data.tickLowerIndex,
206
+
position.data.tickUpperIndex,
210
207
slippageToleranceBps,
211
208
transferFeeA,
212
209
transferFeeB,
@@ -276,11 +273,21 @@ export async function increaseLiquidityInstructions(
276
273
return{
277
274
quote,
278
275
instructions,
279
-
positionMint: positionMintAddress,
280
-
initializationCost: lamports(0n),
281
276
};
282
277
}
283
278
279
+
/**
280
+
* Represents the instructions and quote for opening a position.
281
+
* Extends IncreaseLiquidityInstructions with additional fields for position initialization.
@@ -468,7 +475,7 @@ async function internalOpenPositionInstructions(
468
475
* @param {IncreaseLiquidityQuoteParam} param - The parameters for adding liquidity, where one of `liquidity`, `tokenA`, or `tokenB` must be specified. The SDK will compute the others.
469
476
* @param {number} [slippageToleranceBps=SLIPPAGE_TOLERANCE_BPS] - The maximum acceptable slippage, in basis points (BPS).
470
477
* @param {TransactionSigner} [funder=FUNDER] - The account funding the transaction.
471
-
* @returns {Promise<IncreaseLiquidityInstructions>} A promise that resolves to an object containing the instructions, quote, position mint address, and initialization costs for increasing liquidity.
478
+
* @returns {Promise<OpenPositionInstructions>} A promise that resolves to an object containing the instructions, quote, position mint address, and initialization costs for increasing liquidity.
472
479
*
473
480
* @example
474
481
* import { openFullRangePositionInstructions } from '@orca-so/whirlpools';
@@ -502,7 +509,7 @@ export async function openFullRangePositionInstructions(
@@ -536,7 +543,7 @@ export async function openFullRangePositionInstructions(
536
543
* @param {number} [slippageToleranceBps=SLIPPAGE_TOLERANCE_BPS] - The slippage tolerance for adding liquidity, in basis points (BPS).
537
544
* @param {TransactionSigner} [funder=FUNDER] - The account funding the transaction.
538
545
*
539
-
* @returns {Promise<IncreaseLiquidityInstructions>} A promise that resolves to an object containing instructions, quote, position mint address, and initialization costs for increasing liquidity.
546
+
* @returns {Promise<OpenPositionInstructions>} A promise that resolves to an object containing instructions, quote, position mint address, and initialization costs for increasing liquidity.
540
547
*
541
548
* @example
542
549
* import { openPositionInstructions } from '@orca-so/whirlpools';
@@ -575,7 +582,7 @@ export async function openPositionInstructions(
0 commit comments