Skip to content

Commit 572bb8a

Browse files
authored
feat: dynamic jito tips 2 (#2117)
* add dynamic jito tips * uncomment * go * using jito tip * go * bump * cap it * go * go * test * disable health check * go * increase to 50 pct, take max * add to sample
1 parent 225b9d0 commit 572bb8a

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

apps/price_pusher/config.solana.mainnet.sample.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"jito-endpoint": "mainnet.block-engine.jito.wtf",
66
"jito-keypair-file": "./jito.json",
77
"jito-tip-lamports": "100000",
8+
"dynamic-jito-tips": true,
89
"jito-bundle-size": "5",
910
"updates-per-jito-bundle": "6",
1011
"price-config-file": "./price-config.yaml",

apps/price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "8.2.0",
3+
"version": "8.3.0",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

apps/price_pusher/src/solana/solana.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class SolanaPricePusherJito implements IPricePusher {
181181
}
182182
const data = await response.json();
183183
return Math.floor(
184-
Number(data[0].landed_tips_25th_percentile) * LAMPORTS_PER_SOL
184+
Number(data[0].landed_tips_50th_percentile) * LAMPORTS_PER_SOL
185185
);
186186
} catch (err: any) {
187187
this.logger.error({ err }, "getRecentJitoTips failed");
@@ -194,9 +194,11 @@ export class SolanaPricePusherJito implements IPricePusher {
194194
// eslint-disable-next-line @typescript-eslint/no-unused-vars
195195
_pubTimesToPush: number[]
196196
): Promise<void> {
197-
const jitoTip = this.dynamicJitoTips
198-
? (await this.getRecentJitoTipLamports()) ?? this.defaultJitoTipLamports
199-
: this.defaultJitoTipLamports;
197+
const recentJitoTip = await this.getRecentJitoTipLamports();
198+
const jitoTip =
199+
this.dynamicJitoTips && recentJitoTip !== undefined
200+
? Math.max(this.defaultJitoTipLamports, recentJitoTip)
201+
: this.defaultJitoTipLamports;
200202

201203
const cappedJitoTip = Math.min(jitoTip, this.maxJitoTipLamports);
202204
this.logger.info({ cappedJitoTip }, "using jito tip of");

0 commit comments

Comments
 (0)