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 get_worst_case_base_asset_amount for spot to reduce cu's in place_spot_order #662

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

crispheaney
Copy link
Member

No description provided.

@@ -309,7 +309,7 @@ pub fn place_perp_order(
)?;
}

if force_reduce_only && risk_increasing {
if force_reduce_only && !user.orders[new_order_index].reduce_only {
Copy link
Member

Choose a reason for hiding this comment

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

so if a market is in reduce only mode, a user's order will fail without explicitly setting reduce only flag?

Copy link
Member

Choose a reason for hiding this comment

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

feel like a method is_reducing() would be nicer?

Copy link
Member Author

Choose a reason for hiding this comment

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

is_reducing on what? above if the force_reduce_only is true, the order param is forced to be true

@crispheaney crispheaney merged commit f2b7d2e into master Oct 24, 2023
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