@icgio/icg-exchanges-wrapper 1.21.6 → 1.21.7
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 +3 -3
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -851,15 +851,15 @@ module.exports = class Orders {
|
|
|
851
851
|
}
|
|
852
852
|
for (let exchange in open_orders) {
|
|
853
853
|
for (let pair in open_orders[exchange]) {
|
|
854
|
-
const snapshot_update_time = open_orders[exchange][pair].update_time ? new Date(open_orders[exchange][pair].update_time).getTime() : 0
|
|
855
854
|
open_orders[exchange][pair].open_orders.map((order) => {
|
|
856
855
|
if (_.get(this.order_info, [exchange, pair, order.type, order.order_id])) {
|
|
857
856
|
let order_info = this.order_info[exchange][pair][order.type][order.order_id]
|
|
858
857
|
if (!order_info) {
|
|
859
858
|
return
|
|
860
859
|
}
|
|
861
|
-
const
|
|
862
|
-
|
|
860
|
+
const cancel_grace_window_ms = 15 * 1000
|
|
861
|
+
const cancel_within_grace = order_info.close_time && Date.now() - order_info.close_time < cancel_grace_window_ms
|
|
862
|
+
if (!cancel_within_grace) {
|
|
863
863
|
this.log_terminal_divergence('open_orders', exchange, pair, order.order_id, order_info.status, 'N-FILLED')
|
|
864
864
|
}
|
|
865
865
|
const order_f_amount = round_amount(exchange, pair, order.f_amount)
|