Open
Conversation
a570568 to
5143b3f
Compare
5143b3f to
fadbb3d
Compare
61d7c68 to
c027f4f
Compare
fdde0d2 to
dc02bdf
Compare
veerbal1
reviewed
Feb 3, 2026
danielpavel
requested changes
Feb 7, 2026
Contributor
danielpavel
left a comment
There was a problem hiding this comment.
I think the critical part which needs to be fixed is: "fee growth not initialized for new ticks" - otherwise, looks good to me
* test: Added test to check Uninitialized dynamic tick size * test: Added test for initialized dynamic tick serialization size * test: Add round-trip serialization test for DynamicTick * feat: Add tests for dynamic tick array bitmap management and introduce a test plan and PR review guide. * test: Add unit tests for tick updates and validation in DynamicTickArrayLoader * test: Added tests for next init tick index and clear tick * test: Enhance next init tick index tests to cover additional scenarios * test: added exact bit filp testing when tick init/uninit * test: Add tests for data integrity after tick initialization and uninitialization in DynamicTickArrayLoader * test: Add tests for handling negative start tick indices and edge cases in DynamicTickArrayLoader * test: Add unit tests for DynamicTick::update() fee initialization logic across various scenarios * Added comments on tests
veerbal1
requested changes
Feb 16, 2026
b370c8f to
5643731
Compare
veerbal1
requested changes
Feb 17, 2026
danielpavel
approved these changes
Feb 20, 2026
Contributor
danielpavel
left a comment
There was a problem hiding this comment.
If @veerbal1 issue with stale pointer is taken care of then LGTM
veerbal1
requested changes
Feb 23, 2026
* fix: move dynamic tick array realloc out of update_tick to avoid double borrow Solana's realloc() calls try_borrow_mut_data() internally, which panics when a RefMut is already held. Move realloc to instruction handlers (add_liquidity, burn_liquidity) after borrows are dropped, following Orca's pattern. * refactor: optimize dynamic tick array reallocations in add_liquidity and burn_liquidity Consolidate realloc logic for dynamic tick arrays when both ticks are in the same account, reducing redundant operations. Adjust handling for grow and shrink scenarios to improve efficiency and maintain clarity in memory management. * Setup bankrun tests * created basic mint, ata helper functions * Fix: dropping tick arrays ref. to double mut ref issue * Wrote basic tests to check increase, decrease liquidity within same array * Added various integration tests * Minor cleanup * Added new edge case * removed negative reallocation from add liquidity function * MInor cleanup * Fix pool-level tick_array_bitmap bugs for same-array dynamic positions When both ticks of a position land in the same dynamic tick array, the pool-level bitmap was not updated correctly: Bug 1 (open_position): modify_position initializes both ticks before the bitmap check runs. initialized_tick_count() returns 2, so the guard `if count == 1` never fires and flip_tick_array_bit is never called. The array is invisible to swaps despite having liquidity. Bug 2 (decrease_liquidity): Both ticks are deinitialized before the bitmap check. initialized_tick_count() returns 0 for both checks, causing flip_tick_array_bit (XOR) to fire twice on the same bit. The two XOR operations cancel each other, leaving the bit unchanged. Fix: Capture initialized_tick_count() before modify_position runs. Compare before vs after to decide whether to flip the pool bit. For same-array dynamic positions, only flip once (during the lower tick's check) and skip the upper tick's check entirely. Fixed arrays are unaffected their stored counter approach already works correctly. * Add pool bitmap verification tests for bitmap fix coverage gaps - Overlapping positions: verify pool bitmap unchanged when array already has ticks - Partial decrease: verify pool bitmap stays ON when ticks remain initialized - Fixed same-array: verify pool bitmap set on open, cleared on full decrease * Minor cleanup * Add mutability to tick_array_lower and tick_array_upper in liquidity instructions - Updated IncreaseLiquidityV2 and DecreaseLiquidityV2 structs to mark tick_array_lower and tick_array_upper as mutable accounts, ensuring proper state management during liquidity operations. * Added swap and fee integrity tests * Added more edge cases in testing * Added some more tests
veerbal1
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.