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

Test/new exit contribution #557

Merged
merged 10 commits into from
Nov 29, 2024
Merged

Test/new exit contribution #557

merged 10 commits into from
Nov 29, 2024

Conversation

philbow61
Copy link
Contributor

@philbow61 philbow61 commented Nov 25, 2024

Description

This PR tries to solve the discontinued curve problem that was causing the same sell amount when executed in two swaps resulting in a larger amountOut than when sold in one swap.
The idea is to apply the exitContribution on the G$ amount being sold and burning that amount. In order to not move on the curve by this burn we increase the reserve ratio in order to keep the price before the exitContribution burn equal to the price after.

Other changes

Added requires that ensure the token Supply always stays at a minimum of 1 wei

Tested

  • new tests added ensuring the difference in splitting sells into multiple swaps stays super small compared to the gas costs

Related issues

https://github.com/mento-protocol/mento-general/issues/596
#555

Backwards compatibility

Documentation

@philbow61 philbow61 requested review from baroooo and bowd November 26, 2024 00:10
@philbow61 philbow61 marked this pull request as ready for review November 26, 2024 00:11
Copy link
Contributor

@baroooo baroooo left a comment

Choose a reason for hiding this comment

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

committed my suggestions instead of adding review comments

2fc70ce

Copy link
Contributor

@bowd bowd left a comment

Choose a reason for hiding this comment

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

No comments, immaculate work 😂

@baroooo baroooo merged commit 98290ba into develop Nov 29, 2024
5 checks passed
@baroooo baroooo deleted the test/new-exit-contribution branch November 29, 2024 14:54
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.

3 participants