@clonegod/ttd-core 2.0.24 → 2.0.26

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.
@@ -8,11 +8,11 @@ const token_1 = require("../token");
8
8
  const token_util_1 = require("../token/token_util");
9
9
  function get_pair_name(native_token, pool_name) {
10
10
  let arr = pool_name.split('/');
11
- if (pool_name.includes(native_token) && (pool_name.includes('USDC') || pool_name.includes('USDT'))) {
11
+ if (pool_name.includes(native_token) && (pool_name.includes('USDC') || pool_name.includes('USDT') || pool_name.includes('USD1'))) {
12
12
  if (pool_name.endsWith(native_token)) {
13
13
  arr.reverse();
14
14
  }
15
- return arr.join('/').replace('USDC', 'USDT');
15
+ return arr.join('/').replace('USDC', 'USDT').replace('USD1', 'USDT');
16
16
  }
17
17
  const symbols = pool_name.split('/');
18
18
  if (symbols.includes(native_token)) {
@@ -21,11 +21,11 @@ function get_pair_name(native_token, pool_name) {
21
21
  }
22
22
  return arr.join('/');
23
23
  }
24
- if (symbols.includes('USDC') || symbols.includes('USDT')) {
25
- if (symbols[1] !== 'USDC' && symbols[1] !== 'USDT') {
24
+ if (symbols.includes('USDC') || symbols.includes('USDT') || symbols.includes('USD1')) {
25
+ if (symbols[1] !== 'USDC' && symbols[1] !== 'USDT' && symbols[1] !== 'USD1') {
26
26
  arr.reverse();
27
27
  }
28
- return arr.join('/').replace('USDC', 'USDT');
28
+ return arr.join('/').replace('USDC', 'USDT').replace('USD1', 'USDT');
29
29
  }
30
30
  return pool_name;
31
31
  }
@@ -33,7 +33,7 @@ exports.get_quote_token_decimals = get_quote_token_decimals;
33
33
  function to_price_message(appConfig, quote_amount_usd, tx_price, quote_ask_price, quote_bid_price, pool_info, time, slot) {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
35
  let { pool_address, tokenA, tokenB } = pool_info;
36
- let { dex_id, pool_name, fee_rate, is_reverse_token } = yield appConfig.arb_cache.get_one_pool_info(pool_address);
36
+ let { dex_id, pool_name, fee_rate, is_reverse_token, pair } = yield appConfig.arb_cache.get_one_pool_info(pool_address);
37
37
  let _dex_id = dex_id;
38
38
  let price_id = (0, uuid_1.v4)().replace(/-/gi, '');
39
39
  let chain_id = appConfig.env_args.chain_id;
@@ -49,7 +49,7 @@ function to_price_message(appConfig, quote_amount_usd, tx_price, quote_ask_price
49
49
  pool_id: pool_address,
50
50
  pool_name,
51
51
  fee_rate,
52
- pair: pool_name,
52
+ pair,
53
53
  unique_orderbook_id,
54
54
  is_reverse_token,
55
55
  tokenA: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",