Add to New Position
Create a position NFT and add liquidity in a single transaction. This is the most efficient way to start providing liquidity in DLMM pools.
Prerequisites
Connected wallet with both tokens
Selected distribution strategy (SPOT, CURVE, etc.)
Calculated token amounts needed
Sufficient gas for transaction
Basic Usage
const pair = await sdk.Pair.getPair(pairAddress);
// Create position and add liquidity together
const tx = await sdk.Pair.openPositionAndAddLiquidity(pair, {
amountX: 1000000000n, // 1 token X
amountY: 2000000000n, // 2 token Y
ids: [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],
distributionX: [0, 0, 0, 0, 0, 50, 50, 0, 0, 0, 0],
distributionY: [0, 0, 0, 0, 0, 50, 50, 0, 0, 0, 0]
});
await sdk.fullClient.signAndExecuteTransaction({
transaction: tx,
signer: keypair
});Method Parameters
Quick Examples
Concentrated Liquidity (±5 bins)
Wide Range (±20 bins)
Using Distribution Helpers
What Happens
Creates new position NFT
Deposits tokens into selected bins
Transfers position NFT to your wallet
Returns transaction hash
Common Patterns
Add Around Current Price
Single Bin Liquidity
Related Topics
SPOT Distribution - Uniform liquidity spread
CURVE Distribution - Concentrated liquidity
Calculate Token Amounts - Required tokens
Add to Existing Position - Increase liquidity
Last updated