-
Notifications
You must be signed in to change notification settings - Fork 116
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
bigz/add-tiers-for-liq-perp-pnl #368
Conversation
@@ -1737,6 +1756,10 @@ pub fn liquidate_perp_pnl_for_deposit( | |||
None, | |||
)?; | |||
|
|||
let (safest_tier_spot_liability, safest_tier_perp_liability) = | |||
calculate_user_safest_position_tiers(user, perp_market_map, spot_market_map)?; | |||
let is_contract_tier_violation = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel like it might just be cleaner to check the tier violation here and return early all at once here, instead of spreading the logic, but will defer to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that'd be a lot of copy paste code tho
No description provided.