Yuzu Documentation
  • General Information
    • Introduction
    • Get MOVE Coins
  • Products
    • CLMM
      • Fee Tiers
      • Price Ranges
      • Active & Inactive Liquidity
      • LP Position NFTs
    • Glossary
  • Socials
    • Contacts
    • Brand & Logos
  • Technical
    • Smart Contracts
      • Yuzu CLMM
        • Liquidity Pool
        • Router
        • Scripts
        • Example Usage
          • Liquidity Pool
          • Position NFT Manager Module
          • Tick Math Module
      • Move.Fun
        • Smart Contracts
    • Ecosystem Participants of Yuzu
  • Legal
    • Terms of Use
    • Legal Disclaimer
Powered by GitBook
On this page
  1. Technical
  2. Smart Contracts
  3. Yuzu CLMM
  4. Example Usage

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

PreviousLiquidity PoolNextTick Math Module

Last updated 19 days ago