Skip to content

Fix/protocol liquidity adjustment#1816

Merged
sam0x17 merged 2 commits intodevnet-readyfrom
fix/protocol-liquidity-adjustment
Jul 3, 2025
Merged

Fix/protocol liquidity adjustment#1816
sam0x17 merged 2 commits intodevnet-readyfrom
fix/protocol-liquidity-adjustment

Conversation

@gztensor
Copy link
Contributor

@gztensor gztensor commented Jul 3, 2025

Description

On block step emission, we increase liquidity at protocol position, but do not update ticks or current liquidity. This PR fixes it.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet label Jul 3, 2025
@gztensor gztensor changed the base branch from main to devnet-ready July 3, 2025 20:36
@opentensor opentensor deleted a comment from github-actions bot Jul 3, 2025
JohnReedV
JohnReedV previously approved these changes Jul 3, 2025
@gztensor gztensor added skip-cargo-audit This PR fails cargo audit but needs to be merged anyway and removed hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet labels Jul 3, 2025
sam0x17
sam0x17 previously approved these changes Jul 3, 2025
@axionyu
Copy link
Contributor

axionyu commented Jul 3, 2025

The TIck is not updated with the current liquidity.
The TickIndex::MIN should be added with liquidity_net += liquidity_delta and liquidity gross += liquidity_delta
The TickIndex::MAX should be added with liquidity_net += liquidity_delta and liquidity_gross -= liquidity_delta

@gztensor gztensor dismissed stale reviews from sam0x17 and JohnReedV via e2cafc7 July 3, 2025 21:10
@gztensor
Copy link
Contributor Author

gztensor commented Jul 3, 2025

The TIck is not updated with the current liquidity. The TickIndex::MIN should be added with liquidity_net += liquidity_delta and liquidity gross += liquidity_delta The TickIndex::MAX should be added with liquidity_net += liquidity_delta and liquidity_gross -= liquidity_delta

Thank you! Fixed with the last commit.

@sam0x17 sam0x17 merged commit bcd4cec into devnet-ready Jul 3, 2025
53 of 55 checks passed
@sam0x17 sam0x17 mentioned this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants