@clonegod/ttd-core 3.0.5 → 3.0.7
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/dist/cache/arb_cache.js
CHANGED
|
@@ -43,7 +43,7 @@ class ArbCache {
|
|
|
43
43
|
this.get_token_list_no_cache(),
|
|
44
44
|
this.get_pool_list_no_cache()
|
|
45
45
|
]);
|
|
46
|
-
if ((
|
|
46
|
+
if ((_a = process.env.APP_NAME) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('config-center')) {
|
|
47
47
|
yield this.init_configs();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -57,7 +57,7 @@ class ArbCache {
|
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
var _a;
|
|
59
59
|
let app_name = process.env.APP_NAME;
|
|
60
|
-
if (((_a = process.env.APP_NAME) === null || _a === void 0 ? void 0 : _a.toLowerCase()
|
|
60
|
+
if (!((_a = process.env.APP_NAME) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('config-center'))) {
|
|
61
61
|
(0, index_1.log_warn)(`Only ttd-config-center can initial config! process.env.APP_NAME=${app_name}, return`);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -708,7 +708,8 @@ class ArbCache {
|
|
|
708
708
|
return __awaiter(this, arguments, void 0, function* (token_with_price, ttl = -1) {
|
|
709
709
|
(0, index_1.log_trace)(`cache_market_price, start`);
|
|
710
710
|
if ((0, index_1.isEmpty)(token_with_price.market_price)) {
|
|
711
|
-
|
|
711
|
+
(0, index_1.log_warn)(`cache_token_market_price skip: empty market_price, symbol=${token_with_price.symbol}, address=${token_with_price.address}`);
|
|
712
|
+
return;
|
|
712
713
|
}
|
|
713
714
|
let { symbol } = token_with_price;
|
|
714
715
|
let field = (0, index_1.format_symbol_name)(symbol);
|
package/dist/pool/pool_util.js
CHANGED
|
@@ -48,8 +48,13 @@ function get_quote_token(pair, pool_name) {
|
|
|
48
48
|
function valid_fetch_pool_data(formatted_pool, min_tvl, min_vol, native_token) {
|
|
49
49
|
let { pool_name, pool_address, tokenA, tokenB, tvl, vol_24h } = formatted_pool;
|
|
50
50
|
let symbols = [tokenA.symbol, tokenB.symbol];
|
|
51
|
-
if (
|
|
52
|
-
|
|
51
|
+
if (tvl < min_tvl || vol_24h < min_vol) {
|
|
52
|
+
const reasons = [];
|
|
53
|
+
if (tvl < min_tvl)
|
|
54
|
+
reasons.push(`tvl=${tvl} < minTvl=${min_tvl}`);
|
|
55
|
+
if (vol_24h < min_vol)
|
|
56
|
+
reasons.push(`vol_24h=${vol_24h} < minVol=${min_vol}`);
|
|
57
|
+
throw new Error(`pool is too small: ${pool_name}, ${pool_address}, ${reasons.join(', ')}`);
|
|
53
58
|
}
|
|
54
59
|
if (!symbols.includes(native_token) && !symbols.includes('USDC') && !symbols.includes('USDT') && !symbols.includes('USD1')) {
|
|
55
60
|
throw new Error(`pool don't contains: SOL, USDC, USDT, USD1, ${pool_name}, ${pool_address}`);
|