Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/price_pusher/config.solana.mainnet.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"endpoint": "https://api.mainnet-beta.solana.com",
"keypair-file": "./id.json",
"shard-id": 1,
"jito-endpoint": "mainnet.block-engine.jito.wtf",
"jito-endpoints": "mainnet.block-engine.jito.wtf,amsterdam.mainnet.block-engine.jito.wtf",
"jito-keypair-file": "./jito.json",
"jito-tip-lamports": "100000",
"dynamic-jito-tips": true,
"jito-bundle-size": "5",
"updates-per-jito-bundle": "6",
"price-config-file": "./price-config.stable.sample.yaml",
"price-service-endpoint": "https://hermes.pyth.network/",
"pyth-contract-address": "pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT",
"pushing-frequency": "30"
"pushing-frequency": "30",
"address-lookup-table-account":"GgPa1XHhkqvdJHjQpHaqxThwejgHW8qeW4k4jKVS4Lod"
}
2 changes: 1 addition & 1 deletion apps/price_pusher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/price-pusher",
"version": "9.3.6",
"version": "10.0.0",
"description": "Pyth Price Pusher",
"homepage": "https://pyth.network",
"main": "lib/index.js",
Expand Down
2 changes: 0 additions & 2 deletions apps/price_pusher/src/solana/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ export default {
jitoTipLamports,
dynamicJitoTips,
maxJitoTipLamports,
jitoBundleSize,
updatesPerJitoBundle,
addressLookupTableAccount,
treasuryId,
Expand Down Expand Up @@ -230,7 +229,6 @@ export default {
dynamicJitoTips,
maxJitoTipLamports,
jitoClients,
jitoBundleSize,
updatesPerJitoBundle,
// Set max retry time to pushing frequency, since we want to stop retrying before the next push attempt
pushingFrequency * 1000,
Expand Down
2 changes: 0 additions & 2 deletions apps/price_pusher/src/solana/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export class SolanaPricePusherJito implements IPricePusher {
private dynamicJitoTips: boolean,
private maxJitoTipLamports: number,
private searcherClients: SearcherClient[],
private jitoBundleSize: number,
private updatesPerJitoBundle: number,
private maxRetryTimeMs: number,
private addressLookupTableAccount?: AddressLookupTableAccount,
Expand Down Expand Up @@ -237,7 +236,6 @@ export class SolanaPricePusherJito implements IPricePusher {
const transactions = await transactionBuilder.buildVersionedTransactions({
jitoTipLamports: cappedJitoTip,
tightComputeBudget: true,
jitoBundleSize: this.jitoBundleSize,
});

await sendTransactionsJito(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-solana-receiver",
"version": "0.10.2",
"version": "0.11.0",
"description": "Pyth solana receiver SDK",
"homepage": "https://pyth.network",
"main": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion target_chains/solana/sdk/js/solana_utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/solana-utils",
"version": "0.4.5",
"version": "0.5.0",
"description": "Utility functions for Solana",
"homepage": "https://pyth.network",
"main": "lib/index.js",
Expand Down
22 changes: 12 additions & 10 deletions target_chains/solana/sdk/js/solana_utils/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const DEFAULT_COMPUTE_BUDGET_UNITS = 200000;
export const PACKET_DATA_SIZE_WITH_ROOM_FOR_COMPUTE_BUDGET =
PACKET_DATA_SIZE - 52;

/**
* The maximum number of transactions in a Jito bundle.
*/
export const JITO_BUNDLE_SIZE = 5;

/**
* An instruction with some extra information that will be used to build transactions.
*/
Expand All @@ -46,7 +51,6 @@ export type PriorityFeeConfig = {
computeUnitPriceMicroLamports?: number;
tightComputeBudget?: boolean;
jitoTipLamports?: number;
jitoBundleSize?: number;
};

/**
Expand Down Expand Up @@ -188,7 +192,11 @@ export class TransactionBuilder {
this.transactionInstructions.length - 1
].instructions,
instruction,
buildJitoTipInstruction(this.payer, 1),
this.transactionInstructions.length % JITO_BUNDLE_SIZE === 0 // This transaction may be the first of a Jito bundle, so we leave room for a Jito tip transfer.
? buildJitoTipInstruction(this.payer, 1)
: ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 1,
}),
ComputeBudgetProgram.setComputeUnitLimit({ units: 1 }),
],
true,
Expand Down Expand Up @@ -232,9 +240,6 @@ export class TransactionBuilder {
await this.connection.getLatestBlockhash({ commitment: "confirmed" })
).blockhash;

const jitoBundleSize =
args.jitoBundleSize || this.transactionInstructions.length;

return this.transactionInstructions.map(
({ instructions, signers, computeUnits }, index) => {
const instructionsWithComputeBudget: TransactionInstruction[] = [
Expand All @@ -255,7 +260,7 @@ export class TransactionBuilder {
}),
);
}
if (args.jitoTipLamports && index % jitoBundleSize === 0) {
if (args.jitoTipLamports && index % JITO_BUNDLE_SIZE === 0) {
instructionsWithComputeBudget.push(
buildJitoTipInstruction(this.payer, args.jitoTipLamports),
);
Expand Down Expand Up @@ -297,9 +302,6 @@ export class TransactionBuilder {
buildLegacyTransactions(
args: PriorityFeeConfig,
): { tx: Transaction; signers: Signer[] }[] {
const jitoBundleSize =
args.jitoBundleSize || this.transactionInstructions.length;

return this.transactionInstructions.map(
({ instructions, signers, computeUnits }, index) => {
const instructionsWithComputeBudget: TransactionInstruction[] = [
Expand All @@ -320,7 +322,7 @@ export class TransactionBuilder {
}),
);
}
if (args.jitoTipLamports && index % jitoBundleSize === 0) {
if (args.jitoTipLamports && index % JITO_BUNDLE_SIZE === 0) {
instructionsWithComputeBudget.push(
buildJitoTipInstruction(this.payer, args.jitoTipLamports),
);
Expand Down
Loading