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: more leniency in allowing risk decreasing trades for perps #297

Merged
merged 5 commits into from
Dec 19, 2022

Conversation

crispheaney
Copy link
Member

@crispheaney crispheaney commented Dec 17, 2022

  1. for risk decreasing trades, dont use maintenance buffer ratio when calculating leverage
  2. dont check maker maintenance ratio if they weren't filled

)?;

if !risk_decreasing && market_is_reduce_only {
cancel_risk_increasing_order(
Copy link
Member Author

Choose a reason for hiding this comment

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

when market if reduce only, we force all orders to be reduce_only. and we already check to cancel reduce only orders elsewhere, so this was redundant now

Copy link
Member

Choose a reason for hiding this comment

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

so even if a risk increasing limit order was placed prior to the market becoming reduce only, it will cancel still?

Copy link
Member Author

Choose a reason for hiding this comment

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

no it would still be able to increase the position

Copy link
Member Author

Choose a reason for hiding this comment

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

we can add this back else where

@crispheaney crispheaney merged commit 0f800e3 into master Dec 19, 2022
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