Position NFT Manager Module

  • Name: yuzuswap::position_nft_manager

  • Description: This module provides functions to work with liquidity positions.

Public Functions

Get positions info

Get info of positions with pending fees and pending rewards.

#[view]
public fun get_positions(
    pool_addresses: vector<address>,
    position_ids: vector<u64>,
): vector<Option<Position>>

Parameters

Name
Type
Description

pool_addresses

vector<address>

A list of pool addresses to retrieve position information based on the position IDs vector. The length of pool_addresses must be equal to the length of position_ids

position_ids

vector<u64>

List of position IDs to query

Returns

Type
Description

vector<Option<Position>>

List of position information, where each element is either Some(Position) if the position exists or None if it doesn't

Get position token amounts

Returns the amounts of tokens held in a specific position.

#[view]
public fun get_position_token_amounts(
    pool: Object<LiquidityPool>,
    position_id: u64,
): (u64, u64) acquires ResourceSignerCap

Parameters

Name
Type
Description

pool

Object<LiquidityPool>

The Liquidity Pool object

position_id

u64

The unique identifier for the position

Returns

Type
Description

(u64, u64)

A tuple containing the amounts of token 0 and token 1 in the position

Last updated