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

program: add buffer to calculating max perp if fee #635

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

crispheaney
Copy link
Member

No description provided.

.unwrap_or(u32::MAX),
)
.safe_mul(19)?
.safe_div(20)?;
Copy link
Member

Choose a reason for hiding this comment

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

can you leave comment describing the reason for 5% off

  • update CHANGELOG

@@ -574,7 +574,7 @@ mod calculate_perp_if_fee {
)
.unwrap();

assert_eq!(fee, 39000); // 3.9%
assert_eq!(fee, 37050); // 3.9%
Copy link
Member

Choose a reason for hiding this comment

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

fix comment (with description?)

@@ -560,7 +560,7 @@ mod calculate_perp_if_fee {
)
.unwrap();

assert_eq!(fee, LIQUIDATION_FEE_PRECISION / 50); // 2%
assert_eq!(fee, 19000); // 2%
Copy link
Member

Choose a reason for hiding this comment

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

fix comment (with description?)

.unwrap();

let market_after = perp_market_map.get_ref(&0).unwrap();
assert!(!user.is_being_liquidated());
// .5% * 100 =$0.5
Copy link
Member

Choose a reason for hiding this comment

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

fix comment (with description?)

@crispheaney crispheaney merged commit f2f9bd5 into master Oct 3, 2023
7 of 8 checks passed
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.

None yet

2 participants