From d83cd37732d3f9504b64720e6f86f173362e4a3e Mon Sep 17 00:00:00 2001 From: TheHolyRoger Date: Mon, 5 Apr 2021 14:23:20 +0100 Subject: [PATCH] HitBTC: Update test amounts based on current prices --- .../exchange/hitbtc/test_hitbtc_exchange.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/connector/exchange/hitbtc/test_hitbtc_exchange.py b/test/connector/exchange/hitbtc/test_hitbtc_exchange.py index 9baec3de55..f63d4829d3 100644 --- a/test/connector/exchange/hitbtc/test_hitbtc_exchange.py +++ b/test/connector/exchange/hitbtc/test_hitbtc_exchange.py @@ -144,7 +144,7 @@ def test_estimate_fee(self): def test_buy_and_sell(self): price = self.connector.get_price(self.trading_pair, True) * Decimal("1.02") price = self.connector.quantize_order_price(self.trading_pair, price) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) quote_bal = self.connector.get_available_balance(self.quote_token) base_bal = self.connector.get_available_balance(self.base_token) @@ -178,7 +178,7 @@ def test_buy_and_sell(self): # Try to sell back the same amount to the exchange, and watch for completion event. price = self.connector.get_price(self.trading_pair, True) * Decimal("0.98") price = self.connector.quantize_order_price(self.trading_pair, price) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) order_id = self._place_order(False, amount, OrderType.LIMIT, price, 2) order_completed_event = self.ev_loop.run_until_complete(self.event_logger.wait_for(SellOrderCompletedEvent)) trade_events = [t for t in self.event_logger.event_log if isinstance(t, OrderFilledEvent)] @@ -206,7 +206,7 @@ def test_buy_and_sell(self): def test_limit_makers_unfilled(self): price = self.connector.get_price(self.trading_pair, True) * Decimal("0.8") price = self.connector.quantize_order_price(self.trading_pair, price) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) self.ev_loop.run_until_complete(asyncio.sleep(1)) self.ev_loop.run_until_complete(self.connector._update_balances()) self.ev_loop.run_until_complete(asyncio.sleep(2)) @@ -231,7 +231,7 @@ def test_limit_makers_unfilled(self): price = self.connector.get_price(self.trading_pair, True) * Decimal("1.2") price = self.connector.quantize_order_price(self.trading_pair, price) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) cl_order_id = self._place_order(False, amount, OrderType.LIMIT_MAKER, price, 2) order_created_event = self.ev_loop.run_until_complete(self.event_logger.wait_for(SellOrderCreatedEvent)) @@ -261,7 +261,7 @@ def test_cancel_all(self): ask_price = self.connector.get_price(self.trading_pair, False) bid_price = self.connector.quantize_order_price(self.trading_pair, bid_price * Decimal("0.9")) ask_price = self.connector.quantize_order_price(self.trading_pair, ask_price * Decimal("1.1")) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) buy_id = self._place_order(True, amount, OrderType.LIMIT, bid_price, 1) sell_id = self._place_order(False, amount, OrderType.LIMIT, ask_price, 2) @@ -287,7 +287,7 @@ def test_order_quantized_values(self): # get filled during the test. bid_price = self.connector.quantize_order_price(self.trading_pair, mid_price * Decimal("0.9333192292111341")) ask_price = self.connector.quantize_order_price(self.trading_pair, mid_price * Decimal("1.1492431474884933")) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.000123456")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.000223456")) # Test bid order cl_order_id_1 = self._place_order(True, amount, OrderType.LIMIT, bid_price, 1) @@ -321,7 +321,7 @@ def test_orders_saving_and_restoration(self): price: Decimal = current_bid_price * Decimal("0.8") price = self.connector.quantize_order_price(self.trading_pair, price) - amount: Decimal = Decimal("0.0001") + amount: Decimal = Decimal("0.0002") amount = self.connector.quantize_order_amount(self.trading_pair, amount) cl_order_id = self._place_order(True, amount, OrderType.LIMIT_MAKER, price, 1) @@ -402,7 +402,7 @@ def test_filled_orders_recorded(self): # Try to buy some token from the exchange, and watch for completion event. price = self.connector.get_price(self.trading_pair, True) * Decimal("1.05") price = self.connector.quantize_order_price(self.trading_pair, price) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) order_id = self._place_order(True, amount, OrderType.LIMIT, price, 1) self.ev_loop.run_until_complete(self.event_logger.wait_for(BuyOrderCompletedEvent)) @@ -414,7 +414,7 @@ def test_filled_orders_recorded(self): # Try to sell back the same amount to the exchange, and watch for completion event. price = self.connector.get_price(self.trading_pair, True) * Decimal("0.95") price = self.connector.quantize_order_price(self.trading_pair, price) - amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0001")) + amount = self.connector.quantize_order_amount(self.trading_pair, Decimal("0.0002")) order_id = self._place_order(False, amount, OrderType.LIMIT, price, 2) self.ev_loop.run_until_complete(self.event_logger.wait_for(SellOrderCompletedEvent)) self.ev_loop.run_until_complete(asyncio.sleep(1))