Add to New Position
Prerequisites
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
Common Patterns
Add Around Current Price
Single Bin Liquidity
Related Topics
Last updated