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

fix: proper deal closing when price is changed #1352

Merged
merged 1 commit into from Aug 30, 2018

Conversation

nikonov1101
Copy link
Member

such problem occurs in the following conditions: Connor detects price deviation and starts replacing orders, also it starts to close non-profitalbe deals. When the deal is closed, a worker on another side can pick the order that we schedule for cancellation. This order is turned into a deal that immediately will be closed because of the low price. So this shitfall will perform until all of the orders isn't replaced. This commit fixes that behavior: now Connor checks that the cancel chan is empty before really closing an active deal.

such problem occurs in the following conditions: Connor detects price deviation and starts replacing orders, also it starts to close non-profitalbe deals. When the deal is closed, a worker on another side can pick the order that we schedule for cancellation. This order is turned into a deal that immediately will be closed because of the low price. So this shitfall will perform until all of the orders isn't replaced. This commit fixes that behavior: now Connor checks that the cancel chan is empty before really closing an active deal.
@nikonov1101 nikonov1101 added 💩 T: bug This PR/Issue fixes a bug P: medium This PR/Issue has normal priority V: patch This PR/Issue requires patch version to be bumped S: Connor This PR/Issue changes Connor labels Aug 29, 2018
@antmat antmat merged commit ecdfac7 into master Aug 30, 2018
@antmat
Copy link
Collaborator

antmat commented Aug 30, 2018

crutch, but ok for now. Consider thinking on a better solution

@antmat antmat deleted the fix/connor/wait-order-replace branch August 30, 2018 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: medium This PR/Issue has normal priority S: Connor This PR/Issue changes Connor 💩 T: bug This PR/Issue fixes a bug V: patch This PR/Issue requires patch version to be bumped
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants