@icgio/icg-exchanges-wrapper 1.14.88 → 1.14.90
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 +8 -7
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -507,7 +507,7 @@ module.exports = class Orders {
|
|
|
507
507
|
close_time: trade.close_time || new Date(),
|
|
508
508
|
fees: trade.fees,
|
|
509
509
|
},
|
|
510
|
-
order_info.order_type + ' canceled-order-filled(more)'
|
|
510
|
+
order_info.order_type + ' canceled-order-filled(-more)'
|
|
511
511
|
)
|
|
512
512
|
setTimeout(() => {
|
|
513
513
|
this.delete_order_info(exchange, pair, type, order_id, order_info.order_type + ' canceled-order-filled(-more)')
|
|
@@ -1206,7 +1206,8 @@ module.exports = class Orders {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
check_rates() {
|
|
1208
1208
|
let process_rates = () => {
|
|
1209
|
-
|
|
1209
|
+
let pair_list = _.concat(_.keys(this.pair_exchanges), _.keys(this.pair_exchanges_rates_only))
|
|
1210
|
+
for (let pair of pair_list) {
|
|
1210
1211
|
let orderbook_all = {},
|
|
1211
1212
|
orderbook_all_with_buy_sell_limits_against_reserve_balance = {},
|
|
1212
1213
|
orderbook_major = {},
|
|
@@ -1223,7 +1224,7 @@ module.exports = class Orders {
|
|
|
1223
1224
|
if (_.get(this.rates, [exchange, pair, 'asks'], []).length > 0 && _.get(this.rates, [exchange, pair, 'bids'], []).length > 0) {
|
|
1224
1225
|
const rates = _.cloneDeep(this.rates[exchange][pair])
|
|
1225
1226
|
|
|
1226
|
-
let major_rates_only_exchanges_length = this.major_exchanges[pair].length + _.get(this.rates_only_exchanges, [pair], []).length
|
|
1227
|
+
let major_rates_only_exchanges_length = _.get(this.major_exchanges, [pair], []).length + _.get(this.rates_only_exchanges, [pair], []).length
|
|
1227
1228
|
if (this.major_exchanges[pair] && _.includes(this.major_exchanges[pair], exchange)) {
|
|
1228
1229
|
orderbook_major_temp[exchange] = rates
|
|
1229
1230
|
if (_.keys(orderbook_major_temp).length === major_rates_only_exchanges_length) {
|
|
@@ -1291,9 +1292,9 @@ module.exports = class Orders {
|
|
|
1291
1292
|
} else {
|
|
1292
1293
|
this.rates_combined_good_with_buy_sell_limits_against_reserve_balance = _.omit(this.rates_combined_good_with_buy_sell_limits_against_reserve_balance, [pair])
|
|
1293
1294
|
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
this.rates_combined_major[
|
|
1295
|
+
const reference_pair = this.pair_map_rates_only[pair]
|
|
1296
|
+
if (this.pair_map_rates_only[pair] && this.rates_combined_major[reference_pair]) {
|
|
1297
|
+
this.rates_combined_major[pair] = this.rates_combined_major[reference_pair]
|
|
1297
1298
|
}
|
|
1298
1299
|
}
|
|
1299
1300
|
this.rates_observable.notify()
|
|
@@ -1311,7 +1312,7 @@ module.exports = class Orders {
|
|
|
1311
1312
|
bids = bids.slice(0, RATES_LENGTH_MAX)
|
|
1312
1313
|
_.set(this.rates, [exchange, pair], { asks, bids, update_time: new Date() })
|
|
1313
1314
|
/*
|
|
1314
|
-
* throttle to
|
|
1315
|
+
* throttle to 30ms
|
|
1315
1316
|
*/
|
|
1316
1317
|
throttled_process_rates()
|
|
1317
1318
|
} else if (_.get(this.rates, [exchange, pair, 'update_time']) < new Date().getTime() - this.interval_dict[exchange].rates) {
|