Data structure
Pool
#[resource_group_member(group = aptos_framework::object::ObjectGroup)]
struct LiquidityPoolV3 has key {
token_a_liquidity: Object<FungibleStore>,
token_b_liquidity: Object<FungibleStore>,
token_a_fee: Object<FungibleStore>,
token_b_fee: Object<FungibleStore>,
// the current price
sqrt_price: u128,
// liquidity current tick
liquidity: u128,
// the current tick
tick: I32,
// the most-recently updated index of the observations array
observation_index: u64,
// the current maximum number of observations that are being stored
observation_cardinality: u64,
// the next maximum number of observations to store, triggered in observations.write
observation_cardinality_next: u64,
/// The numerator of fee rate, the denominator is 1_000_000.
fee_rate: u64,
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// the denominator is 1_000_000.
fee_protocol: u64,
// whether the pool is locked
unlocked: bool,
fee_growth_global_a: u128,
fee_growth_global_b: u128,
seconds_per_liquidity_oracle: u128,
seconds_per_liquidity_incentive: u128,
position_blacklist: PositionBlackList,
last_update_timestamp: u64,
tick_info: SmartTable<I32, TickInfo>,
tick_map: BitMap,
tick_spacing: u32,
protocol_fees: ProtocolFees,
lp_token_refs: LPTokenRefs,
max_liquidity_per_tick: u128,
rewarder_manager: RewarderManager
}
Position
Rewarder
Last updated