Open Position

Create a new liquidity position NFT in a Ferra pool.

Quick Start

import { clmmMainnet, initFerraSDK } from '@ferra-labs/clmm'

// Initialize SDK
const sdk = initFerraSDK({
  ...clmmMainnet,
  network: 'beta',
  fullNodeUrl: 'https://...',
  wallet: '0x...'
})

const tx = sdk.Position.openPositionTransactionPayload({
  pool_id: '0x...',
  coinTypeA: '0x2::sui::SUI', 
  coinTypeB: '0x...::usdc::USDC',
  tick_lower: -1000,
  tick_upper: 1000
})

// Execute
const result = await sdk.fullClient.signAndExecuteTransaction({
  transaction: tx,
  signer: keypair
})

Parameters

Parameter
Type
Description

pool_id

string

Pool object ID

coinTypeA

string

First token type

coinTypeB

string

Second token type

tick_lower

number

Lower price boundary

tick_upper

number

Upper price boundary

Price Range

Set Custom Range

Range Around Current Price

Complete Example

Important Notes

  • Opening a position creates an empty NFT without liquidity

  • Add liquidity separately after position creation

  • Position NFT is transferable and tradeable

  • Each position has unique tick range that cannot be changed

Last updated