@clonegod/ttd-sol-common 1.0.87 → 1.0.89
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.
|
@@ -19,13 +19,14 @@ const JITO_TIP_MIN = 0.00004;
|
|
|
19
19
|
const JITO_TIP_MAX = 0.0005;
|
|
20
20
|
function get_jito_tip_floor() {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
(0, dist_1.log_info)(`get_jito_tip_floor
|
|
22
|
+
let res = yield (yield fetch(jito_tip_stats_url)).json();
|
|
23
|
+
(0, dist_1.log_info)(`get_jito_tip_floor,res=`, res);
|
|
24
|
+
return res[0];
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
function refresh_jito_tip_floor() {
|
|
27
28
|
setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
get_jito_tip_floor();
|
|
29
|
+
jito_tip_pct = yield get_jito_tip_floor();
|
|
29
30
|
}), 1 * 60 * 1000);
|
|
30
31
|
}
|
|
31
32
|
refresh_jito_tip_floor();
|
|
@@ -35,14 +36,16 @@ function get_latest_jito_tip(speed, fee_max_cap) {
|
|
|
35
36
|
if (!jito_tip_pct) {
|
|
36
37
|
jito_tip_pct = yield get_jito_tip_floor();
|
|
37
38
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
}
|
|
46
49
|
}
|
|
47
50
|
if (tip_sol < JITO_TIP_MIN) {
|
|
48
51
|
tip_sol = JITO_TIP_MIN;
|