Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

op_underfunded when hit capacity limits and increasing order size of first level with resullt not hitting capacity limits #69

Closed
nikhilsaraf opened this issue Dec 2, 2018 · 0 comments

Comments

@nikhilsaraf
Copy link
Contributor

nikhilsaraf commented Dec 2, 2018

Describe the bug

The following conditions have to be met in order for the bot to get an op_underfunded error:

  • current levels needs to be > 1
  • bot is currently hitting capacity limits
  • bot tries to increase order size of first level but reduce total size of orders such that it will not be hitting capacity limits anymore

Expected behavior

I think the correct behavior in this situation is for the bot to handle these cases correctly without having to manually delete all the offers as a workaround

Frequency

The frequency is: Always in the described situation

Steps To Reproduce

Here are the steps to reproduce the issue (see attachments in section below):

  1. Set up the bot to use two levels with the first level being small and the second level consuming the remaining balance so it hits capacity limits
  2. once the orderbook is updated to this setting, stop the bot and update the levels such that the first level is bigger and the second level is less then what remains from the balance such that the bot will no longer hit capacity limits.
  3. Start the bot, you will see the op_underfunded error because the bot tries to increase the first level before trying to reduce the second level which leaves it in a state where it cannot fund the first operation.

Possible Solution

This bug can be fixed by reordering operations when we modify a level that will reduce the size of an order even if we will not hit capacity limits.

Your Environment

  version: master:v1.2.0-2-g5b6224b7
  git branch: master
  git hash: 5b6224b7b47fd3ed9f22ad3f127dce787691324d
  build date: 20181202T000856Z
  GOOS: linux
  GOARCH: amd64
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant