Skip to content

Commit 031ac4e

Browse files
committed
feat(pusher): expose treasury-id param
1 parent 3ca88ad commit 031ac4e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

apps/price_pusher/src/solana/command.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ export default {
8686
type: "string",
8787
optional: true,
8888
} as Options,
89+
"treasury-id": {
90+
description:
91+
"The treasuryId to use. Useful when the corresponding treasury account is indexed in the ALT passed to --address-lookup-table-account. This is a tx size optimization and is optional; if not set, a random treasury account will be used.",
92+
type: "number",
93+
optional: true,
94+
} as Options,
8995
...options.priceConfigFile,
9096
...options.priceServiceEndpoint,
9197
...options.pythContractAddress,
@@ -113,6 +119,7 @@ export default {
113119
jitoBundleSize,
114120
updatesPerJitoBundle,
115121
addressLookupTableAccount,
122+
treasuryId,
116123
logLevel,
117124
controllerLogLevel,
118125
} = argv;
@@ -156,15 +163,15 @@ export default {
156163
connection,
157164
wallet,
158165
pushOracleProgramId: new PublicKey(pythContractAddress),
166+
treasuryId: treasuryId,
159167
});
160168

161169
// Fetch the account lookup table if provided
162-
const lookupTableAccount =
163-
(
164-
await connection.getAddressLookupTable(
165-
new PublicKey(addressLookupTableAccount)
166-
)
167-
).value ?? undefined;
170+
const lookupTableAccount = addressLookupTableAccount
171+
? await connection
172+
.getAddressLookupTable(new PublicKey(addressLookupTableAccount))
173+
.then((result) => result.value ?? undefined)
174+
: undefined;
168175

169176
let solanaPricePusher;
170177
if (jitoTipLamports) {

0 commit comments

Comments
 (0)