@icgio/icg-exchanges-wrapper 1.21.10 → 1.21.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/middleware/orders.js +5 -1
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -768,7 +768,11 @@ module.exports = class Orders {
|
|
|
768
768
|
if (exchange_status === 'N-FILLED') continue
|
|
769
769
|
const local_filled_amount = round_amount(exchange, pair, local_order.f_amount || 0)
|
|
770
770
|
const polled_filled_amount = round_amount(exchange, pair, polled_order.f_amount || 0)
|
|
771
|
-
|
|
771
|
+
const compare_total = round_amount(exchange, pair, local_order.t_amount || polled_order.t_amount || 0)
|
|
772
|
+
const both_effectively_filled = compare_total > 0 &&
|
|
773
|
+
local_filled_amount / compare_total > this.f_filled_threshold &&
|
|
774
|
+
polled_filled_amount / compare_total > this.f_filled_threshold
|
|
775
|
+
if (local_order.status === exchange_status && (local_filled_amount === polled_filled_amount || both_effectively_filled)) continue
|
|
772
776
|
this.log_terminal_divergence('query_order', exchange, pair, polled_order.order_id, local_order.status, exchange_status)
|
|
773
777
|
if (local_order.status === 'F-FILLED' && exchange_status === 'P-FILLED') continue
|
|
774
778
|
const merged_filled_amount = Math.max(polled_filled_amount, local_filled_amount)
|