@icgio/icg-exchanges-wrapper 1.14.172 → 1.14.174
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 +9 -8
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -149,7 +149,7 @@ module.exports = class Orders {
|
|
|
149
149
|
this.interval_dict[exchange].positions = this.interval_dict[exchange].positions || 10 * 1000
|
|
150
150
|
this.interval_dict[exchange].open_orders = this.interval_dict[exchange].open_orders || 10 * 1000
|
|
151
151
|
this.interval_dict[exchange].trades = this.interval_dict[exchange].trades || 10 * 1000
|
|
152
|
-
this.interval_dict[exchange].query_order = this.interval_dict[exchange].query_order || 10 * 1000
|
|
152
|
+
this.interval_dict[exchange].query_order = this.interval_dict[exchange].query_order || 10 * 60 * 1000
|
|
153
153
|
this.interval_dict[exchange].rates = this.interval_dict[exchange].rates || 1 * 1000
|
|
154
154
|
this.interval_dict[exchange].market_history = this.interval_dict[exchange].market_history || 2 * 1000
|
|
155
155
|
this.interval_dict[exchange].ohlcv = this.interval_dict[exchange].ohlcv || 10 * 60 * 1000
|
|
@@ -181,7 +181,7 @@ module.exports = class Orders {
|
|
|
181
181
|
positions_check: false,
|
|
182
182
|
open_orders_check: true,
|
|
183
183
|
trades_check: true,
|
|
184
|
-
|
|
184
|
+
query_order_check_arb_maker_1: true,
|
|
185
185
|
query_order_check_exchange: {},
|
|
186
186
|
rates_check: true,
|
|
187
187
|
market_history_check: true,
|
|
@@ -201,7 +201,7 @@ module.exports = class Orders {
|
|
|
201
201
|
this.trades_amount_past_hour = {}
|
|
202
202
|
this.check_trades()
|
|
203
203
|
}
|
|
204
|
-
if (this.function_enabled.
|
|
204
|
+
if (this.function_enabled.query_order_check_arb_maker_1) {
|
|
205
205
|
for (let exchange in this.Exchanges) {
|
|
206
206
|
if (this.function_enabled.query_order_check_exchange[exchange]) {
|
|
207
207
|
this.check_query_order(exchange)
|
|
@@ -226,7 +226,7 @@ module.exports = class Orders {
|
|
|
226
226
|
this.process_open_orders(this.open_orders)
|
|
227
227
|
}, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
|
|
228
228
|
}
|
|
229
|
-
if (this.function_enabled.
|
|
229
|
+
if (this.function_enabled.query_order_check_arb_maker_1) {
|
|
230
230
|
setInterval(() => {
|
|
231
231
|
this.process_query_order(this.query_order)
|
|
232
232
|
}, PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS)
|
|
@@ -450,7 +450,8 @@ module.exports = class Orders {
|
|
|
450
450
|
for (let pair in this.order_info[exchange]) {
|
|
451
451
|
for (let type in this.order_info[exchange][pair]) {
|
|
452
452
|
for (let order_id in this.order_info[exchange][pair][type]) {
|
|
453
|
-
|
|
453
|
+
const order_type_temp = _.get(this.order_info, [exchange, pair, type, order_id, 'order_type'])
|
|
454
|
+
if ((Array.isArray(order_type) && order_type.includes(order_type_temp)) || order_type_temp === order_type) {
|
|
454
455
|
_.setWith(order_info_temp, `${exchange}.${pair}.${type}.${order_id}`, _.get(this.order_info, `${exchange}.${pair}.${type}.${order_id}`), Object)
|
|
455
456
|
}
|
|
456
457
|
}
|
|
@@ -1145,8 +1146,8 @@ module.exports = class Orders {
|
|
|
1145
1146
|
get_trades_all(this.Exchanges, this.exchange_pairs, this.interval_dict)
|
|
1146
1147
|
}
|
|
1147
1148
|
check_query_order(exchange) {
|
|
1148
|
-
const QUERY_ORDER_TIME_IN_MS = 30 * 60 * 1000
|
|
1149
|
-
|
|
1149
|
+
// const QUERY_ORDER_TIME_IN_MS = 30 * 60 * 1000
|
|
1150
|
+
const QUERY_ORDER_TIME_IN_MS = 0
|
|
1150
1151
|
let query_order_handler = (exchange, pair, res) => {
|
|
1151
1152
|
if (res.success) {
|
|
1152
1153
|
_.set(this.query_order, [exchange, pair], { query_order: res.body, update_time: new Date() })
|
|
@@ -1159,7 +1160,7 @@ module.exports = class Orders {
|
|
|
1159
1160
|
}
|
|
1160
1161
|
let get_query_order_all = (Exchanges, exchange_pairs, interval_dict) => {
|
|
1161
1162
|
let query_order = (exchange, pair) => {
|
|
1162
|
-
let order_info = _.get(this.
|
|
1163
|
+
let order_info = _.get(this.get_order_info_by_order_type(['arb', 'maker_1']), [exchange, pair], {})
|
|
1163
1164
|
let timeout = setTimeout(() => {
|
|
1164
1165
|
query_order(exchange, pair)
|
|
1165
1166
|
}, interval_dict[exchange].query_order)
|