The Solana RPC client.
The mint address of the NFT that represents the position.
The parameters for adding liquidity. Can specify liquidity, Token A, or Token B amounts.
Optional
slippageToleranceBps: number = SLIPPAGE_TOLERANCE_BPSThe maximum acceptable slippage, in basis points (BPS).
Optional
authority: TransactionSigner = FUNDERThe account that authorizes the transaction.
A promise that resolves to an object containing instructions, quote, position mint address, and initialization costs for increasing liquidity.
import { increaseLiquidityInstructions, setWhirlpoolsConfig } from '@orca-so/whirlpools';
import { createSolanaRpc, devnet, address } from '@solana/web3.js';
import { loadWallet } from './utils';
await setWhirlpoolsConfig('solanaDevnet');
const devnetRpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));
const wallet = await loadWallet();
const positionMint = address("HqoV7Qv27REUtmd9UKSJGGmCRNx3531t33bDG1BUfo9K");
const param = { tokenA: 10n };
const { quote, instructions } = await increaseLiquidityInstructions(
devnetRpc,
positionMint,
param,
100,
wallet
);
console.log(`Quote token max B: ${quote.tokenEstB}`);
Generates instructions to increase liquidity for an existing position.