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

Liquidity Pool

Extract key attributes of a position

This function is used to extract key attributes of a position.

public fun extract_core_position(
    position: &Position,
): (u64, u32, u32, u128, u256, u256, u64, u64)

Function arguments

Argument
Type
Description

position

&Position

The current position to extract detailed data.

Returns

Type
Description

u64

Position identifier

u32

Lower tick boundary

u32

Upper tick boundary

u128

Liquidity value

u256

Fee growth inside for token 0

u256

Fee growth inside for token 1

u64

Pending fees for position in token 0

u64

Pending fees for position in token 1

Extract position rewards

This function is used to extract all reward information associated with the given position.

public fun extract_position_rewards(
    position: &Position,
): vector<PositionRewardInfo>

Function arguments

Argument
Type
Description

position

&Position

A reference to the position from which reward details are retrieved

Returns

Type
Description

vector<PositionRewardInfo>

A vector containing all reward information records of the position

Extract reward info of a position

This function is used to extract the detailed reward data from a position reward information.

public fun extract_reward_info(
    reward_info: &PositionRewardInfo,
): (u256, u64)

Function arguments

Argument
Type
Description

reward_info

&PositionRewardInfo

A reference to the reward info record to extract detailed data

Returns

Type
Description

u256

The reward growth accumulated

u64

The pending reward amount

PreviousExample UsageNextPosition NFT Manager Module

Last updated 19 days ago