pub fn _modify_position<'info>(
    liquidity_delta: i64,
    pool_state: &mut PoolState,
    position_state: &AccountLoader<'info, PositionState>,
    tick_lower_state: &AccountLoader<'info, TickState>,
    tick_upper_state: &AccountLoader<'info, TickState>,
    bitmap_lower: &AccountLoader<'info, TickBitmapState>,
    bitmap_upper: &AccountLoader<'info, TickBitmapState>,
    last_observation_state: &AccountLoader<'info, ObservationState>,
    remaining_accounts: &[AccountInfo<'info>]
) -> Result<(i64, i64)>
Expand description

Credit or debit liquidity to a position, and find the amount of token_0 and token_1 required to produce this change. Returns amount of token_0 and token_1 owed to the pool, negative if the pool should pay the recipient.

Arguments

  • position_state - Effect change to this position
  • tick_lower_state- Program account for the lower tick boundary
  • tick_upper_state- Program account for the upper tick boundary
  • bitmap_lower - Holds the initialization state of the lower tick
  • bitmap_upper - Holds the initialization state of the upper tick
  • last_observation_state - The last written oracle observation, having index = pool.observation_index. This condition must be externally tracked.
  • next_observation_state - The observation account following last_observation_state. Becomes equal to last_observation_state when cardinality is 1.
  • lamport_destination - Destination account for freed lamports when a tick state is un-initialized
  • liquidity_delta - The change in liquidity. Can be 0 to perform a poke.