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

Add liquidate margin test #598

Merged
merged 2 commits into from
Nov 24, 2023
Merged

Add liquidate margin test #598

merged 2 commits into from
Nov 24, 2023

Conversation

QGarchery
Copy link
Contributor

This PR tests the computation to make sure that a borrow position is safe (if nothing changes) for a period elapsed

@QGarchery QGarchery requested a review from a team November 21, 2023 12:48
@QGarchery QGarchery self-assigned this Nov 21, 2023
@QGarchery QGarchery requested review from Rubilmax, MerlinEgalite and Jean-Grimal and removed request for a team November 21, 2023 12:48
@QGarchery
Copy link
Contributor Author

Notice that this is the same test as testLiquidateHealthyPosition but extended with a warping of elapsed seconds before the expectRevert. I don't think we should remove that test though

Copy link
Contributor

@Rubilmax Rubilmax left a comment

Choose a reason for hiding this comment

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

Great!

MerlinEgalite
MerlinEgalite previously approved these changes Nov 21, 2023
Copy link
Contributor

@MerlinEgalite MerlinEgalite left a comment

Choose a reason for hiding this comment

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

LGTM! Curious what was the motivation behind that test?

@QGarchery
Copy link
Contributor Author

Curious what was the motivation behind that test?

This comes from the idea of @daejunpark in #522, where we want to ensure that there is a computation to verify that, even with interest accrual, your borrow position will stay safe. This PR is more modest than testing all the possible functions after some time elapsed, but I think it captures most of the idea

Jean-Grimal
Jean-Grimal previously approved these changes Nov 22, 2023
MathisGD
MathisGD previously approved these changes Nov 22, 2023
@MathisGD MathisGD merged commit 9f4fc70 into main Nov 24, 2023
4 checks passed
@MathisGD MathisGD deleted the test/liquidate-margin branch November 24, 2023 09:39
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.

5 participants