pub fn position_ratio(
    current_sqrt_price: u128,
    tick_index_1: i32,
    tick_index_2: i32,
) -> PositionRatio
Expand description

Calculate the token_a / token_b ratio of a (ficticious) position

§Parameters

  • sqrt_price - A u128 integer representing the sqrt price of the pool
  • tick_index_1 - A i32 integer representing the first tick index of the position
  • tick_index_2 - A i32 integer representing the second tick index of the position

§Returns

  • A PositionRatio struct containing the ratio of token_a and token_b