Position Module
Manages user liquidity positions and fee tracking
Structs
LBPosition
struct LBPosition has key, store {
id: UID,
pair_id: ID,
coin_type_a: TypeName,
coin_type_b: TypeName,
lock_until: u64,
}Purpose: NFT representing liquidity position
LBPositionManager
struct LBPositionManager has store {
positions: Table<ID, LBPositionInfo>,
}Purpose: Manages all position data
LBPositionInfo
struct LBPositionInfo has store {
position_id: ID,
bins: Table<u32, LBBinPosition>,
fee_reward_info: FeeRewardInfo,
}Purpose: Detailed position data
LBBinPosition
Purpose: Position data for specific price bin
FeeRewardInfo
Purpose: Fee generation and reward tracking
Core Functions
Position Lifecycle
open_position: Create new position NFTclose_position: Destroy empty positionlock_position: Apply time lockis_position_locked: Check lock status
Liquidity Operations
increase_liquidity: Add liquidity to positiondecrease_liquidity: Remove liquidity (respects locks)
Fee Management
collect_fees: Harvest accumulated feesget_pending_fees: View unclaimed feesupdate_fee_info: Update fee tracking (internal)
Position Queries
position_token_amount: Liquidity in specific binget_tokens_in_position: All position liquidityhas_tokens_in_bins: Check if position has liquidity
Last updated