The Solana RPC client.
The address of the liquidity pool.
The parameters for adding liquidity, where one of liquidity
, tokenA
, or tokenB
must be specified. The SDK will compute the others.
Optional
slippageToleranceBps: number = SLIPPAGE_TOLERANCE_BPSThe maximum acceptable slippage, in basis points (BPS).
Optional
funder: TransactionSigner = FUNDERThe account funding the transaction.
A promise that resolves to an object containing the instructions, quote, position mint address, and initialization costs for increasing liquidity.
import { openFullRangePositionInstructions, setWhirlpoolsConfig } from '@orca-so/whirlpools';
import { generateKeyPairSigner, createSolanaRpc, devnet, address } from '@solana/web3.js';
await setWhirlpoolsConfig('solanaDevnet');
const devnetRpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));
const wallet = await generateKeyPairSigner(); // CAUTION: This wallet is not persistent.
const whirlpoolAddress = address("POOL_ADDRESS");
const param = { tokenA: 1_000_000n };
const { quote, instructions, initializationCost, positionMint } = await openFullRangePositionInstructions(
devnetRpc,
whirlpoolAddress,
param,
100,
wallet
);
Opens a full-range position for a pool, typically used for Splash Pools or other full-range liquidity provisioning.