@clonegod/ttd-sol-common 1.0.58 → 1.0.59
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.
|
@@ -574,8 +574,8 @@ class RpcClient {
|
|
|
574
574
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
575
575
|
const serializedTransaction = bs58_1.default.encode(transaction.serialize());
|
|
576
576
|
let jitoApiUrl = `${types_1.JITO_API_URLS[region]}/api/v1/bundles`;
|
|
577
|
-
if (
|
|
578
|
-
jitoApiUrl =
|
|
577
|
+
if (solana_trade_runtime.jito_plugin_url) {
|
|
578
|
+
jitoApiUrl = solana_trade_runtime.jito_plugin_url;
|
|
579
579
|
}
|
|
580
580
|
const bundleId = yield this.sendJitoBundle([serializedTransaction], jitoApiUrl);
|
|
581
581
|
(0, dist_1.log_info)(`sendJitoBundle`, {
|
|
@@ -5,22 +5,30 @@ const dist_1 = require("@clonegod/ttd-common/dist");
|
|
|
5
5
|
const constants_1 = require("../common/constants");
|
|
6
6
|
function create_solana_trade_runtime(connection, trade_runtime, pool_info) {
|
|
7
7
|
let trade_strategy = trade_runtime.settings.strategy;
|
|
8
|
-
let { cu_limit } = pool_info;
|
|
8
|
+
let { cu_limit, use_jito_plugin } = pool_info;
|
|
9
9
|
if (isNaN(cu_limit) || cu_limit < 35000) {
|
|
10
10
|
cu_limit = 35000;
|
|
11
11
|
}
|
|
12
12
|
let priority_fee = calculate_gas_fee(trade_strategy);
|
|
13
13
|
let cu_price = Math.ceil(priority_fee * constants_1.ONE_MILLION / cu_limit);
|
|
14
|
+
let jito_plugin_url = '';
|
|
15
|
+
if (use_jito_plugin) {
|
|
16
|
+
jito_plugin_url = process.env.QUICKNODE_JITO_PLUGIN_URL;
|
|
17
|
+
}
|
|
14
18
|
(0, dist_1.log_info)(`trade_strategy & gas`, {
|
|
15
19
|
trade_strategy,
|
|
16
20
|
priority_fee,
|
|
17
21
|
cu_limit,
|
|
18
|
-
cu_price
|
|
22
|
+
cu_price,
|
|
23
|
+
use_jito_plugin,
|
|
24
|
+
jito_plugin_url
|
|
19
25
|
});
|
|
20
26
|
let solana_trade_runtime = Object.assign(Object.assign({}, trade_runtime), { connection,
|
|
21
27
|
priority_fee,
|
|
22
28
|
cu_limit,
|
|
23
|
-
cu_price
|
|
29
|
+
cu_price,
|
|
30
|
+
use_jito_plugin,
|
|
31
|
+
jito_plugin_url });
|
|
24
32
|
return solana_trade_runtime;
|
|
25
33
|
}
|
|
26
34
|
exports.create_solana_trade_runtime = create_solana_trade_runtime;
|
package/package.json
CHANGED