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

Adjust Market Order Logic When Limit Orders Are Disabled #758

Merged
merged 4 commits into from
Nov 11, 2022

Conversation

nlordell
Copy link
Contributor

@nlordell nlordell commented Nov 9, 2022

This PR adjusts the order classification logic.

Specifically, when limit orders were disabled, it was possible to create market orders with a 0-fee (as the 0-fee would cause it to skip the get_quote_and_check_fee fee check but disabled limit orders make the order be considered a market order).

@fedgiac and I already applied a hotfix in production, this PR adds the fix to main as
well. This is not urgent (as limit orders are enabled in staging, so it is not possible to create 0-fee market orders ATM).

Additionally, this PR also:

  • restores the behaviour of out-of-market orders being flagged as liquidity orders
  • only stores quotes at order creation if an existing quote wasn't found. This is to avoid orders that are created with a specific quote ID getting a different one.

Test Plan

Changed the test that checks 0-fee market orders error validation when limit orders are disabled, and added a new test to prevent regressions of the liquidity classification for out-of market orders.

@nlordell nlordell requested a review from a team as a code owner November 9, 2022 21:24
@nlordell nlordell enabled auto-merge (squash) November 11, 2022 16:26
@nlordell
Copy link
Contributor Author

Merging this with a single approval as @fedgiac reviewed the changes with me when creating the v2.80.2 release and this is an important change for next week.

@nlordell nlordell merged commit 9204718 into main Nov 11, 2022
@nlordell nlordell deleted the adjust-market-order-logic branch November 11, 2022 16:29
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants