Position

Manage liquidity positions in Ferra DAMM pools: open, add liquidity, remove liquidity, and query positions

Get Positions

Retrieve liquidity positions from Ferra DAMM pools.

Quick Start

// Get all user positions
const positions = await sdk.Position.getPositionList('0x...')

// Get single position
const position = await sdk.Position.getPositionById('0x...')

Get User Positions

const userAddress = '0x...'

// All positions
const allPositions = await sdk.Position.getPositionList(userAddress)

// Filter by pools
const poolIds = ['0xpool1...', '0xpool2...']
const poolPositions = await sdk.Position.getPositionList(userAddress, poolIds)

// Without display data (faster)
const positions = await sdk.Position.getPositionList(userAddress, [], false)

Get Single Position

Get Simple Position

Lightweight fetch without reward calculations — faster when you only need basic position data:

Position Data

Get Token Amounts

Filter Positions

Active Positions

In-Range Positions

By Token Pair

Transaction History

Complete Example

Error Handling


Open Position

Create a new liquidity position NFT in a Ferra DAMM pool.

Quick Start

Parameters

Parameter
Type
Description

pool_id

string

Pool object ID

coinTypeA

string

Type of coin A

coinTypeB

string

Type of coin B

tick_lower

string

Lower tick boundary

tick_upper

string

Upper tick 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


Add Liquidity

Add tokens to a liquidity position in Ferra DAMM pools.

Methods

1. Add Liquidity by Amount

Specify exact liquidity amount to add:

2. Add Liquidity Fixed Token

Fix one token amount, calculate the other:

Important Notes

  • SDK automatically collects fees before adding liquidity

  • Excess tokens are returned to sender

  • Position must exist before adding liquidity

  • Cannot change position's tick range


Remove Liquidity

Withdraw tokens from a liquidity position in Ferra DAMM pools.

Quick Start

Parameters

Parameter
Type
Description

pool_id

string

Pool object ID

pos_id

string

Position object ID

coinTypeA

string

Type of coin A

coinTypeB

string

Type of coin B

delta_liquidity

string

Amount of liquidity to remove

min_amount_a

string

Minimum amount of coin A to receive

min_amount_b

string

Minimum amount of coin B to receive

collect_fee

boolean

Whether to collect fees

rewarder_coin_types

string[]

Rewarder coin types to collect

Calculate Token Amounts

Complete Example

Close Position

Remove all liquidity and close a position permanently.

Quick Start

Parameters

Parameter
Type
Description

pool_id

string

Pool object ID

pos_id

string

Position object ID

coinTypeA

string

Type of coin A

coinTypeB

string

Type of coin B

min_amount_a

string

Minimum amount of coin A to receive

min_amount_b

string

Minimum amount of coin B to receive

collect_fee

boolean

Whether to collect fees

rewarder_coin_types

string[]

Rewarder coin types to collect

Close with Slippage Protection

Complete Example

Close vs Remove Liquidity

Feature
Close Position
Remove Liquidity

Burns Position NFT

Yes

No

Partial Removal

No

Yes

Recoverable

No

Yes


Lock Position

Lock a position to prevent closing or removing liquidity until a specified time. Useful for governance, vesting, or proving commitment to liquidity.

Lock a Position

Check Lock Status

Important Notes

  • Locked positions cannot be closed or have liquidity removed

  • You can still collect fees and rewards from locked positions

  • Lock time can only be extended, not shortened

  • The lock timestamp is in Unix seconds


Error Handling

Important Notes

  • SDK automatically collects fees before removing liquidity

  • Tokens are sent directly to sender address

  • Cannot remove more liquidity than position contains

  • Position NFT remains after removing all liquidity

  • Closing automatically collects all fees and rewards

  • Position NFT is burned on close and cannot be recovered

Last updated