Function cyclos_core::_modify_position
source · [−]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 positiontick_lower_state- Program account for the lower tick boundarytick_upper_state- Program account for the upper tick boundarybitmap_lower- Holds the initialization state of the lower tickbitmap_upper- Holds the initialization state of the upper ticklast_observation_state- The last written oracle observation, having index = pool.observation_index. This condition must be externally tracked.next_observation_state- The observation account followinglast_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-initializedliquidity_delta- The change in liquidity. Can be 0 to perform a poke.