From d6b324b006ea1f973b5dd6b5333b147b1ad9a512 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Fri, 15 Nov 2024 15:21:02 -0800 Subject: [PATCH] use jito for multithreaded fillers always + add new address to prior fee subscriber --- src/bots/switchboardCranker.ts | 9 +++++---- src/config.ts | 1 + src/experimental-bots/filler/fillerMultithreaded.ts | 3 +++ .../spotFiller/spotFillerMultithreaded.ts | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bots/switchboardCranker.ts b/src/bots/switchboardCranker.ts index 758a12e3..f769d898 100644 --- a/src/bots/switchboardCranker.ts +++ b/src/bots/switchboardCranker.ts @@ -64,13 +64,14 @@ export class SwitchboardCrankerBot implements Bot { ); await this.slothashSubscriber.subscribe(); - this.priorityFeeSubscriber?.updateAddresses( - Object.entries(this.crankConfigs.pullFeedConfigs).map( + this.priorityFeeSubscriber?.updateAddresses([ + ...Object.entries(this.crankConfigs.pullFeedConfigs).map( ([_alias, config]) => { return new PublicKey(config.pubkey); } - ) - ); + ), + ...this.crankConfigs.writableAccounts.map((acc) => new PublicKey(acc)), + ]); } async reset(): Promise { diff --git a/src/config.ts b/src/config.ts index 91710897..2f00c914 100644 --- a/src/config.ts +++ b/src/config.ts @@ -116,6 +116,7 @@ export type SwitchboardCrankerBotConfig = BaseBotConfig & { pubkey: string; }; }; + writableAccounts: string[]; }; export type BotConfigMap = { diff --git a/src/experimental-bots/filler/fillerMultithreaded.ts b/src/experimental-bots/filler/fillerMultithreaded.ts index 6b58f515..38255ec9 100644 --- a/src/experimental-bots/filler/fillerMultithreaded.ts +++ b/src/experimental-bots/filler/fillerMultithreaded.ts @@ -270,6 +270,9 @@ export class FillerMultithreaded { lookupTableAccounts: AddressLookupTableAccount[] = [] ) { this.globalConfig = globalConfig; + if (!this.globalConfig.useJito && runtimeSpec.driftEnv === 'mainnet-beta') { + throw new Error('Jito is required for spot multithreaded filler'); + } this.name = config.botId; this.config = config; this.dryRun = config.dryRun; diff --git a/src/experimental-bots/spotFiller/spotFillerMultithreaded.ts b/src/experimental-bots/spotFiller/spotFillerMultithreaded.ts index eed26f16..a77c9c85 100644 --- a/src/experimental-bots/spotFiller/spotFillerMultithreaded.ts +++ b/src/experimental-bots/spotFiller/spotFillerMultithreaded.ts @@ -279,6 +279,9 @@ export class SpotFillerMultithreaded { lookupTableAccounts: AddressLookupTableAccount[] = [] ) { this.globalConfig = globalConfig; + if (!this.globalConfig.useJito && runtimeSpec.driftEnv === 'mainnet-beta') { + throw new Error('Jito is required for spot multithreaded filler'); + } this.config = config; this.name = config.botId; this.dryRun = config.dryRun;