Skip to content

Commit

Permalink
CoinZoom: Change poll interval and balance update trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHolyRoger committed Apr 2, 2021
1 parent a154b79 commit d8a8c6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hummingbot/connector/exchange/coinzoom/coinzoom_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class Constants:
# Intervals
# Only used when nothing is received from WS
SHORT_POLL_INTERVAL = 5.0
# CoinZoom poll interval can't be too long since we don't get balances via websockets
LONG_POLL_INTERVAL = 8.0
# One minute should be fine since we request balance updates on order updates
LONG_POLL_INTERVAL = 60.0
# One minute should be fine for order status since we get these via WS
UPDATE_ORDER_STATUS_INTERVAL = 60.0
# 10 minute interval to update trading rules, these would likely never change whilst running.
Expand Down
3 changes: 2 additions & 1 deletion hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,11 @@ def _process_order_message(self, order_msg: Dict[str, Any]):
# Estimate fee
order_msg["trade_fee"] = self.estimate_fee_pct(tracked_order.order_type is OrderType.LIMIT_MAKER)
updated = tracked_order.update_with_order_update(order_msg)
# Call Update balances on every message to catch order create, fill and cancel.
safe_ensure_future(self._update_balances())

if updated:
safe_ensure_future(self._trigger_order_fill(tracked_order, order_msg))
safe_ensure_future(self._update_balances())
elif tracked_order.is_cancelled:
self.logger().info(f"Successfully cancelled order {tracked_order.client_order_id}.")
self.stop_tracking_order(tracked_order.client_order_id)
Expand Down

0 comments on commit d8a8c6d

Please sign in to comment.