Get Position Info

1. Get position amounts

  • params:

    • position_nft: the object of the position

  • return:

    • amount_a: the amount of token a in position.

    • amount_b: the amount of token b in position

// tucana_clmm::pool
#[view]
public fun get_position_amounts(
    position_nft: Object<PositionNft>,
): (u64, u64) acquires Pool {
    ...
}

2. Calculate position fee

  • params:

    • position_nft: the object of the position

  • return:

    • fee_a: the fee amount of coin type a.

    • fee_b: the fee amount of coin type b.

// tucana_clmm::pool
#[view]
public fun calculate_fee(
    position_nft: Object<PositionNft>,
): (u64, u64) acquires Pool {
    ...
}

3. Get rewards in position

  • params:

    • position_nft: the object of the position

  • return:

    • fee_a: the fee amount of coin type a.

    • fee_b: the fee amount of coin type b.

// tucana_clmm::pool
#[view]
public fun calculate_rewards(
    position_nft: Object<PositionNft>,
): vector<u64> acquires Pool {
    ...
}

Last updated