Skip to content

Commit

Permalink
Adjust inaccuracy for full-sized closer order
Browse files Browse the repository at this point in the history
New algo allows 5% difference for closer order instead of fixed amount

Closes: #739
  • Loading branch information
bitphage committed Mar 18, 2020
1 parent 00c9636 commit 00a920f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dexbot/strategies/staggered_orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1644,11 +1644,12 @@ def place_closer_order(
# Check whether new order will excess the limiter. Limiter is set based on own_aseet_limit or
# opposite_asset_limit kwargs
if balance < limiter:
missing = limiter - balance
if allow_partial or (
# Accept small inaccuracy for full-sized closer order
place_order
and not allow_partial
and limiter - balance < 20 * 10 ** -precision
and missing / limiter < 0.05
):
self.log.debug(
'Limiting {} order amount to available asset balance: {:.{prec}f} {}'.format(
Expand Down

0 comments on commit 00a920f

Please sign in to comment.