Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Virtual Balances when Adding/Removing liquidity #5

Merged
merged 6 commits into from
Mar 18, 2025

Conversation

joaobrunoah
Copy link
Collaborator

Description

Create 2 new hooks: onBeforeAddLiquidity and onBeforeRemoveLiquidity. These hooks adjust the virtual balances when an Add and Remove liquidity occurs.

We also make sure that price and pool centeredness are not changed.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Optimization: [ ] gas / [ ] bytecode
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

Closes #1

Copy link
Contributor

@elshan-eth elshan-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The formula corresponds to what is in notion

@joaobrunoah joaobrunoah merged commit 1edc622 into main Mar 18, 2025
3 checks passed
@joaobrunoah joaobrunoah deleted the add-remove-liquidity branch March 19, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create add/remove liquidity hooks
2 participants