@clonegod/ttd-sol-common 1.0.106 → 1.0.109
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.
|
@@ -32,7 +32,6 @@ const get_quote_token_decimals = (pool_info) => {
|
|
|
32
32
|
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) {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
let quote_token_decimals = (0, exports.get_quote_token_decimals)(pool_info);
|
|
36
35
|
let { pool_address, tokenA, tokenB } = pool_info;
|
|
37
36
|
let { dex_id, pool_name, fee_rate, is_reverse_token } = yield appConfig.arb_cache.get_one_pool_info(pool_address);
|
|
38
37
|
let _dex_id = dex_id;
|
|
@@ -41,8 +40,8 @@ function to_price_message(appConfig, quote_amount_usd, tx_price, quote_ask_price
|
|
|
41
40
|
let unique_orderbook_id = (0, dist_1.format_unique_orderbook_id)(chain_id, _dex_id, pool_address, fee_rate);
|
|
42
41
|
time.price_time = new Date().getTime();
|
|
43
42
|
let fee_rate_bps = fee_rate / 100100;
|
|
44
|
-
let ask_price = getAskPrice(new decimal_js_1.default(quote_ask_price), fee_rate_bps * 0
|
|
45
|
-
let bid_price = getBidPrice(new decimal_js_1.default(quote_bid_price), fee_rate_bps * 0
|
|
43
|
+
let ask_price = getAskPrice(new decimal_js_1.default(quote_ask_price), fee_rate_bps * 0);
|
|
44
|
+
let bid_price = getBidPrice(new decimal_js_1.default(quote_bid_price), fee_rate_bps * 0);
|
|
46
45
|
let price_message = {
|
|
47
46
|
chain_id,
|
|
48
47
|
dex_id,
|
|
@@ -69,7 +68,7 @@ function to_price_message(appConfig, quote_amount_usd, tx_price, quote_ask_price
|
|
|
69
68
|
name: tokenB.name,
|
|
70
69
|
enable: true,
|
|
71
70
|
},
|
|
72
|
-
tx_price: tx_price === null || tx_price === void 0 ? void 0 : tx_price.toFixed(
|
|
71
|
+
tx_price: tx_price === null || tx_price === void 0 ? void 0 : tx_price.toFixed(12),
|
|
73
72
|
quote_amount_usd,
|
|
74
73
|
ask: {
|
|
75
74
|
price: ask_price,
|
|
@@ -85,11 +84,11 @@ function to_price_message(appConfig, quote_amount_usd, tx_price, quote_ask_price
|
|
|
85
84
|
return price_message;
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
|
-
const getAskPrice = (price, feeRate
|
|
89
|
-
return price.mul(1 + feeRate).toFixed(
|
|
87
|
+
const getAskPrice = (price, feeRate) => {
|
|
88
|
+
return price.mul(1 + feeRate).toFixed(12);
|
|
90
89
|
};
|
|
91
|
-
const getBidPrice = (price, feeRate
|
|
92
|
-
return price.mul(1 - feeRate).toFixed(
|
|
90
|
+
const getBidPrice = (price, feeRate) => {
|
|
91
|
+
return price.mul(1 - feeRate).toFixed(12);
|
|
93
92
|
};
|
|
94
93
|
function normalize_pair_name(priceMessage) {
|
|
95
94
|
let { pool_name, is_reverse_token } = priceMessage;
|
|
@@ -21,7 +21,7 @@ var jito_tip_floor;
|
|
|
21
21
|
const jito_tip_stats_url = process.env.JITO_TIP_FEE_STATS_URL || 'https://bundles.jito.wtf/api/v1/bundles/tip_floor';
|
|
22
22
|
const JITO_TIP_DEFAULT = 0.00018;
|
|
23
23
|
const JITO_TIP_MIN = 0.00008;
|
|
24
|
-
const JITO_TIP_MAX = 0.
|
|
24
|
+
const JITO_TIP_MAX = 0.001;
|
|
25
25
|
function get_jito_tip_floor() {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
try {
|
|
@@ -57,7 +57,7 @@ function get_latest_jito_tip(speed, fee_max_cap) {
|
|
|
57
57
|
if (tip_sol > JITO_TIP_MAX) {
|
|
58
58
|
tip_sol = JITO_TIP_MAX;
|
|
59
59
|
}
|
|
60
|
-
let tip_lamports = Math.ceil((tip_sol * 1.
|
|
60
|
+
let tip_lamports = Math.ceil((tip_sol * 1.01) * web3_js_1.LAMPORTS_PER_SOL);
|
|
61
61
|
if (tip_lamports > fee_max_cap) {
|
|
62
62
|
tip_lamports = fee_max_cap;
|
|
63
63
|
}
|