• Generates instructions to increase liquidity for an existing position.

    Parameters

    • rpc: Rpc<
          GetAccountInfoApi & GetMultipleAccountsApi & GetMinimumBalanceForRentExemptionApi & GetEpochInfoApi,
      >

      The Solana RPC client.

    • positionMintAddress: Address

      The mint address of the NFT that represents the position.

    • param: IncreaseLiquidityQuoteParam

      The parameters for adding liquidity. Can specify liquidity, Token A, or Token B amounts.

    • OptionalslippageToleranceBps: number = SLIPPAGE_TOLERANCE_BPS

      The maximum acceptable slippage, in basis points (BPS).

    • Optionalauthority: TransactionSigner = FUNDER

      The account that authorizes the transaction.

    Returns Promise<IncreaseLiquidityInstructions>

    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}`);