createAndAddLiquidity

This method simultaneously creates a position and adds liquidity. The NFT, which represents the position, will be sent to the creator's address. All subsequent operations will require using the position ID (NFT).

Signature

addLiquidity(options: AddLiquidityOptions): Promise<Transaction>

Params

interface AddLiquidityOptions {
  // pool object ID
  pool: string;
  // Operator address
  address: string;
   // Amount of coin A
  amountA: string | number; 
  // Amount of coin B
  amountB: string | number;
  // Represents the index of the lower tick boundary
  tickLower: number;
  // Represents the index of the upper tick boundary
  tickUpper: number;
  // Acceptable wasted amount percentage. Range: [0, 100)
  slippage: string | number;
  // Expires timeout(ms), defaults 60_000
  deadline?: number;
  // Custom transaction handler
  txb?: Transaction;
}

Examples

Last updated