@clonegod/ttd-sol-common 1.0.88 → 1.0.90
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.
|
@@ -21,12 +21,12 @@ function get_jito_tip_floor() {
|
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
let res = yield (yield fetch(jito_tip_stats_url)).json();
|
|
23
23
|
(0, dist_1.log_info)(`get_jito_tip_floor,res=`, res);
|
|
24
|
-
|
|
24
|
+
return res[0];
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function refresh_jito_tip_floor() {
|
|
28
28
|
setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
get_jito_tip_floor();
|
|
29
|
+
jito_tip_pct = yield get_jito_tip_floor();
|
|
30
30
|
}), 1 * 60 * 1000);
|
|
31
31
|
}
|
|
32
32
|
refresh_jito_tip_floor();
|
|
@@ -36,14 +36,16 @@ function get_latest_jito_tip(speed, fee_max_cap) {
|
|
|
36
36
|
if (!jito_tip_pct) {
|
|
37
37
|
jito_tip_pct = yield get_jito_tip_floor();
|
|
38
38
|
}
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
if (jito_tip_pct) {
|
|
40
|
+
if (speed === 'fast') {
|
|
41
|
+
tip_sol = jito_tip_pct['landed_tips_50th_percentile'];
|
|
42
|
+
}
|
|
43
|
+
if (speed === 'turbo') {
|
|
44
|
+
tip_sol = jito_tip_pct['landed_tips_75th_percentile'];
|
|
45
|
+
}
|
|
46
|
+
if (speed === 'ultra') {
|
|
47
|
+
tip_sol = jito_tip_pct['landed_tips_95th_percentile'];
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
if (tip_sol < JITO_TIP_MIN) {
|
|
49
51
|
tip_sol = JITO_TIP_MIN;
|
|
@@ -59,12 +59,12 @@ const try_lock_order_msg = (appConfig, order_msg) => __awaiter(void 0, void 0, v
|
|
|
59
59
|
exports.try_lock_order_msg = try_lock_order_msg;
|
|
60
60
|
const handle_order_message = (appConfig, trade, message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
61
|
(0, dist_1.new_line)(3);
|
|
62
|
-
(0, dist_1.log_info)(`handle_order_message, on message: `, message);
|
|
63
62
|
setTimeout(() => {
|
|
64
63
|
console.log(`=================================================================================`);
|
|
65
64
|
console.log(`| NEW ORDER MESSAGE |`);
|
|
66
65
|
console.log(`=================================================================================`);
|
|
67
66
|
}, 0);
|
|
67
|
+
(0, dist_1.log_info)(`handle_order_message, on message: `, message);
|
|
68
68
|
let order_event_message = JSON.parse(message);
|
|
69
69
|
if (dist_1.LOG.debug) {
|
|
70
70
|
(0, dist_1.log_debug)(`order_event_msg`, order_event_message);
|