@icgio/icg-exchanges-wrapper 1.9.100 → 1.9.101
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 +4 -4
- package/package.json +1 -1
package/middleware/orders.js
CHANGED
|
@@ -609,14 +609,14 @@ module.exports = class Orders {
|
|
|
609
609
|
let cur_balance = _.get(this.balances, [exchange, 'available', cur], 0)
|
|
610
610
|
let base_cur_balance = _.get(this.balances, [exchange, 'available', base_cur], 0)
|
|
611
611
|
let pair = cur + base_cur
|
|
612
|
-
let max_cur_amount = cur_balance - this.min_reserve_balance[exchange
|
|
613
|
-
let max_base_cur_amount = base_cur_balance - this.min_reserve_balance[exchange
|
|
614
|
-
if (max_cur_amount > 0) {
|
|
612
|
+
let max_cur_amount = cur_balance - _.get(this.min_reserve_balance, [exchange, cur], 0)
|
|
613
|
+
let max_base_cur_amount = base_cur_balance - _.get(this.min_reserve_balance, [exchange, base_cur], 0)
|
|
614
|
+
if (max_cur_amount > 0 || cur_balance === 0) {
|
|
615
615
|
} else {
|
|
616
616
|
console.error('balance low', exchange, cur, cur_balance, this.min_reserve_balance[exchange][cur])
|
|
617
617
|
max_cur_amount = 0
|
|
618
618
|
}
|
|
619
|
-
if (max_base_cur_amount > 0) {
|
|
619
|
+
if (max_base_cur_amount > 0 || base_cur_balance === 0) {
|
|
620
620
|
} else {
|
|
621
621
|
console.error('balance low', exchange, cur, base_cur_balance, this.min_reserve_balance[exchange][base_cur])
|
|
622
622
|
max_base_cur_amount = 0
|