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

Limit max balance to be used per asset, insufficient balance error #649

Closed
thehapax opened this issue Aug 4, 2019 · 7 comments
Closed
Assignees

Comments

@thehapax
Copy link
Collaborator

thehapax commented Aug 4, 2019

Expected Behavior

handle insufficient balance thrown exception more gracefully.
Also requested add method to limit max balance to be used per asset.

Actual Behavior

Digital Lucife®, [4 Aug 2019 at 8:42:51 AM]:
Can you limit max balance to be used per asset ?

Traceback (most recent call last):
File "site-packages\grapheneapi\api.py", line 168, in func
File "site-packages\grapheneapi\rpc.py", line 138, in method
File "site-packages\grapheneapi\rpc.py", line 106, in parse_response
grapheneapi.exceptions.RPCError: Assert Exception: d.get_balance( *_seller, *_sell_asset ) >= op.amount_to_sell: insufficient balance

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "dexbot\worker.py", line 125, in on_block
File "site-packages\events\events.py", line 95, in call
File "dexbot\strategies\staggered_orders.py", line 2009, in tick
File "dexbot\strategies\staggered_orders.py", line 239, in maintain_strategy
File "dexbot\orderengines\bitshares_engine.py", line 479, in execute
File "site-packages\graphenecommon\transactionbuilder.py", line 504, in broadcast
File "site-packages\graphenecommon\transactionbuilder.py", line 498, in broadcast
File "site-packages\grapheneapi\api.py", line 176, in func
File "site-packages\bitsharesapi\bitsharesnoderpc.py", line 24, in post_process_exception
bitsharesapi.exceptions.UnhandledRPCError: Assert Exception: d.get_balance( *_seller, *_sell_asset ) >= op.amount_to_sell: insufficient balance

@PermieBTS
Copy link
Collaborator

@joelvai could you add a specific error warning to the GUI to notify the user that there is an unsufficient balance in the account?

@thehapax
Copy link
Collaborator Author

thehapax commented Aug 5, 2019

from Digital Lucifer - this was on windows, binary install of latest DEXBot

@bitphage bitphage self-assigned this Aug 5, 2019
@bitphage
Copy link
Collaborator

bitphage commented Aug 5, 2019

This is related to SO logic, generally this should not happen. Looks like there is some rare condition when it tries to go out of balance.

@joelvai
Copy link
Collaborator

joelvai commented Aug 8, 2019

Like @bitfag said, this seems to be a rare condition. Reproducing this would help to fix it properly. One solution would be to raise @gui_error in bitshares_engine.

@bitphage
Copy link
Collaborator

bitphage commented Aug 9, 2019

I have an idea why this could happen, but a few log lines from dexbot.log before the traceback would be helpful.

@dls-cipher
Copy link

Like @bitfag said, this seems to be a rare condition. Reproducing this would help to fix it properly. One solution would be to raise @gui_error in bitshares_engine.

You just have to run with latest binary/install on Windows DEXBot, create staggered orders worker and wait for balance to be depleted.

@bitphage
Copy link
Collaborator

bitphage commented Aug 9, 2019

This is not a windows-specific error as strategy logic is platform-independent. The error probably caused by self.check_min_order_size() correction, which is happening only in specific conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants