drop sleep_time and use python-bittrex request delay
This commit is contained in:
		| @@ -161,9 +161,5 @@ def get_name() -> str: | |||||||
|     return _API.name |     return _API.name | ||||||
|  |  | ||||||
|  |  | ||||||
| def get_sleep_time() -> float: |  | ||||||
|     return _API.sleep_time |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def get_fee() -> float: | def get_fee() -> float: | ||||||
|     return _API.fee |     return _API.fee | ||||||
|   | |||||||
| @@ -21,11 +21,6 @@ class Bittrex(Exchange): | |||||||
|     TICKER_METHOD: str = BASE_URL + '/Api/v2.0/pub/market/GetTicks' |     TICKER_METHOD: str = BASE_URL + '/Api/v2.0/pub/market/GetTicks' | ||||||
|     PAIR_DETAIL_METHOD: str = BASE_URL + '/Market/Index' |     PAIR_DETAIL_METHOD: str = BASE_URL + '/Market/Index' | ||||||
|  |  | ||||||
|     @property |  | ||||||
|     def sleep_time(self) -> float: |  | ||||||
|         """ Sleep time to avoid rate limits, used in the main loop """ |  | ||||||
|         return 25 |  | ||||||
|  |  | ||||||
|     def __init__(self, config: dict) -> None: |     def __init__(self, config: dict) -> None: | ||||||
|         global _API, _EXCHANGE_CONF |         global _API, _EXCHANGE_CONF | ||||||
|  |  | ||||||
|   | |||||||
| @@ -18,14 +18,6 @@ class Exchange(ABC): | |||||||
|         :return: percentage in float |         :return: percentage in float | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|     @property |  | ||||||
|     @abstractmethod |  | ||||||
|     def sleep_time(self) -> float: |  | ||||||
|         """ |  | ||||||
|         Sleep time in seconds for the main loop to avoid API rate limits. |  | ||||||
|         :return: float |  | ||||||
|         """ |  | ||||||
|  |  | ||||||
|     @abstractmethod |     @abstractmethod | ||||||
|     def buy(self, pair: str, rate: float, amount: float) -> str: |     def buy(self, pair: str, rate: float, amount: float) -> str: | ||||||
|         """ |         """ | ||||||
|   | |||||||
| @@ -299,8 +299,6 @@ def main(): | |||||||
|             time.sleep(1) |             time.sleep(1) | ||||||
|         elif new_state == State.RUNNING: |         elif new_state == State.RUNNING: | ||||||
|             _process() |             _process() | ||||||
|             # We need to sleep here because otherwise we would run into bittrex rate limit |  | ||||||
|             time.sleep(exchange.get_sleep_time()) |  | ||||||
|         old_state = new_state |         old_state = new_state | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user