stellar-deprecated / kelp

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
https://kelpbot.io
Other
1.09k stars 262 forks source link

Mirror Strategy is unable to cover position when balance on backing exchange is low #700

Open nikhilsaraf opened 3 years ago

nikhilsaraf commented 3 years ago

This should never happen because we should consider the balance on backing exchange when placing orders such that we can always cover.

This causes bot to crash.

The result of a low balance should be that we are unable to place orders on that one side (bid or ask) because the available balance from the balanceChecker results in a net 0 order amount.

problem encountered while running the fill tracker: error when running an iteration of fill tracker: caught an error when tracking fills: error in a fill handler: error when offsetting trade (newOrder=Order[pair=<pair>, action=sell, type=limit, price=<price>, vol=<amt>, ts=<nil>]): error while creating limit order Order[pair=<pair>, action=sell, type=limit, price=<price>, vol=<amt>, ts=<nil>]: error creating order: error in response, body
String: {"message":"<exchangeName>__ {\"code\":-2010,\"msg\":\"Account has insufficient balance for requested action.\"}","error":{}}