Skip to content

Cancel the kickstarted order immediately if balance is not sufficient.#992

Merged
artemii235 merged 2 commits intodevfrom
zero-balance-order-kickstart
Jun 29, 2021
Merged

Cancel the kickstarted order immediately if balance is not sufficient.#992
artemii235 merged 2 commits intodevfrom
zero-balance-order-kickstart

Conversation

@artemii235
Copy link
Copy Markdown

@sergeyboyko0791
Copy link
Copy Markdown

I thought the balance checking is performed on BalanceUpdateOrdermatchHandler::balance_updated. Does the test_maker_order_should_not_kick_start_and_appear_in_orderbook_if_balance_is_withdrawn test fail without the changes in lp_ordermatch.rs?

@artemii235
Copy link
Copy Markdown
Author

Yes, it fails because a balance check is performed once per 10 seconds - an order is broadcast to the network during this time and can be matched leading to errors described in the issue.

Comment thread mm2src/lp_ordermatch.rs Outdated
shamardy
shamardy previously approved these changes Jun 21, 2021
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Approved!

@artemii235 artemii235 merged commit 728fe3d into dev Jun 29, 2021
@artemii235 artemii235 deleted the zero-balance-order-kickstart branch June 29, 2021 10:00
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