@icgio/icg-exchanges-wrapper 1.14.217 → 1.14.219

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.
@@ -35,11 +35,12 @@ module.exports = class Account {
35
35
 
36
36
  console.log('exchange_assets_benchmarks', this.exchange_assets_benchmarks)
37
37
 
38
- let USDCNY, USDHKD, USDKRW
38
+ this.forex_rates = {}
39
39
  forex_rate.get_forex_rate_usd(['CNY', 'HKD', 'KRW'], (res) => {
40
- USDCNY = res['CNY']
41
- USDHKD = res['HKD']
42
- USDKRW = res['KRW']
40
+ console.log('forex_rates', res)
41
+ this.forex_rates['CNYUSD'] = res['CNY']
42
+ this.forex_rates['HKDUSD'] = res['HKD']
43
+ this.forex_rates['KRWUSD'] = res['KRW']
43
44
  })
44
45
  }
45
46
  get_depth(rates, cmc_rates, percentages) {
@@ -129,11 +130,11 @@ module.exports = class Account {
129
130
  if (_.includes(constants.stablecoins, cur)) {
130
131
  profit.USD += position
131
132
  } else if (_.includes(['KRW'], cur)) {
132
- profit.USD += position / USDKRW
133
+ profit.USD += position / this.forex_rates['KRWUSD']
133
134
  } else if (_.includes(['HKD'], cur)) {
134
- profit.USD += position / USDHKD
135
+ profit.USD += position / this.forex_rates['HKDUSD']
135
136
  } else if (_.includes(['CNYT'], cur)) {
136
- profit.USD += position / USDCNY
137
+ profit.USD += position / this.forex_rates['CNYUSD']
137
138
  } else {
138
139
  if (!cmc_rates[cur]) {
139
140
  console.log('get_exchange_profit rates_cmc %s does not exist', cur)
@@ -67,7 +67,7 @@ const PROCESS_OPEN_ORDERS_TRADERS_INTERVAL_MS = 500
67
67
  const MARKET_HISTORY_DEFAULT_MS = 10 * 60 * 1000
68
68
  const TRADES_DEFAULT_MS = 7 * 24 * 60 * 60 * 1000
69
69
  const NO_CALLBACK_TIMEOUT_MS = 2 * 60 * 1000
70
- const PROCESS_RATES_THROTTLE_MS = 20
70
+ const PROCESS_RATES_THROTTLE_MS = 75
71
71
 
72
72
  module.exports = class Orders {
73
73
  constructor(exchange_cur_quote_cur_dict, cd, settings) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-exchanges-wrapper",
3
- "version": "1.14.217",
3
+ "version": "1.14.219",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {