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

Remove unnecessary checks from liquidityMathAddDelta function #168

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Remove unnecessary checks from liquidityMathAddDelta function #168

merged 1 commit into from
Feb 19, 2024

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Feb 16, 2024

Description

When the result(z) became negative is generally due to the incorrect input values. For example, if x is negative and y is a positive number that is less than the absolute value of that negative number (e.g., x=-100, y=50). Here, z turn out to be negative value(-50). Another case is when both input values are negative.

So I think it's sufficient to simply check that z is negative.

Copy link
Member

@r3v4s r3v4s left a comment

Choose a reason for hiding this comment

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

code is getter better :D

pool/liquidity_math.gno Show resolved Hide resolved
@notJoon notJoon merged commit 75e1250 into gnoswap-labs:main Feb 19, 2024
@notJoon notJoon deleted the refact-pool/liquidity-math branch February 19, 2024 07:09
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