diff --git a/dexbot/__init__.py b/dexbot/__init__.py index 864d36c2f..98c73107a 100644 --- a/dexbot/__init__.py +++ b/dexbot/__init__.py @@ -3,7 +3,7 @@ from appdirs import user_config_dir APP_NAME = "dexbot" -VERSION = '0.1.26' +VERSION = '0.1.27' AUTHOR = "codaone" __version__ = VERSION diff --git a/dexbot/basestrategy.py b/dexbot/basestrategy.py index dbd97698d..230fe7433 100644 --- a/dexbot/basestrategy.py +++ b/dexbot/basestrategy.py @@ -1,5 +1,6 @@ import logging import time +import math from .storage import Storage from .statemachine import StateMachine @@ -151,7 +152,7 @@ def calculate_center_price(self): ) self.disabled = True else: - center_price = (highest_bid['price'] + lowest_ask['price']) / 2 + center_price = highest_bid['price'] * math.sqrt(lowest_ask['price'] / highest_bid['price']) return center_price def calculate_relative_center_price(self, spread, order_ids=None): @@ -300,7 +301,7 @@ def _cancel(self, orders): self.bitshares.txbuffer.clear() return False else: - raise + self.log.exception("Unable to cancel order") return True def cancel(self, orders):