We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be9e36 commit e4394adCopy full SHA for e4394ad
programs/amm/src/instructions/swap.rs
@@ -475,11 +475,10 @@ pub fn swap_internal<'b, 'info>(
475
}
476
// update tick
477
if state.tick != pool_state.tick_current {
478
+ // update the previous tick to the observation
479
+ observation_state.update(block_timestamp, pool_state.tick_current);
480
pool_state.tick_current = state.tick;
481
- // update the previous price to the observation
- observation_state.update(block_timestamp, pool_state.tick_current);
482
-
483
pool_state.sqrt_price_x64 = state.sqrt_price_x64;
484
485
if liquidity_start != state.liquidity {
0 commit comments