diff --git a/package.json b/package.json index 706f1512..4a217a7c 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "lib/index.js", "license": "Apache-2.0", "dependencies": { - "@drift-labs/jit-proxy": "0.12.98", - "@drift-labs/sdk": "2.110.0-beta.3", + "@drift-labs/jit-proxy": "0.13.4", + "@drift-labs/sdk": "2.110.0-beta.5", "@opentelemetry/api": "1.7.0", "@opentelemetry/auto-instrumentations-node": "0.31.2", "@opentelemetry/exporter-prometheus": "0.31.0", diff --git a/src/bots/filler.ts b/src/bots/filler.ts index 61803d5e..6206c80d 100644 --- a/src/bots/filler.ts +++ b/src/bots/filler.ts @@ -375,7 +375,7 @@ export class FillerBot extends TxThreaded implements Bot { // Pyth lazer: remember to remove devnet guard if (this.globalConfig.driftEnv == 'devnet') { - if (!this.globalConfig.lazerEndpoint || !this.globalConfig.lazerToken) { + if (!this.globalConfig.lazerEndpoints || !this.globalConfig.lazerToken) { throw new Error('Missing lazerEndpoint or lazerToken in global config'); } @@ -385,7 +385,7 @@ export class FillerBot extends TxThreaded implements Bot { const pythLazerIds = markets.map((m) => m.pythLazerId!); const pythLazerIdsChunks = chunks(pythLazerIds, 5); this.pythLazerSubscriber = new PythLazerSubscriber( - this.globalConfig.lazerEndpoint, + this.globalConfig.lazerEndpoints, this.globalConfig.lazerToken, pythLazerIdsChunks, this.globalConfig.driftEnv diff --git a/src/bots/makerBidAskTwapCrank.ts b/src/bots/makerBidAskTwapCrank.ts index 910a60b9..0d900af0 100644 --- a/src/bots/makerBidAskTwapCrank.ts +++ b/src/bots/makerBidAskTwapCrank.ts @@ -210,7 +210,7 @@ export class MakerBidAskTwapCrank implements Bot { this.bundleSender = bundleSender; // Pyth lazer: remember to remove devnet guard - if (!this.globalConfig.lazerEndpoint || !this.globalConfig.lazerToken) { + if (!this.globalConfig.lazerEndpoints || !this.globalConfig.lazerToken) { throw new Error('Missing lazerEndpoint or lazerToken in global config'); } @@ -220,7 +220,7 @@ export class MakerBidAskTwapCrank implements Bot { const pythLazerIds = markets.map((m) => m.pythLazerId!); const pythLazerIdsChunks = chunks(pythLazerIds, 4); this.pythLazerSubscriber = new PythLazerSubscriber( - this.globalConfig.lazerEndpoint, + this.globalConfig.lazerEndpoints, this.globalConfig.lazerToken, pythLazerIdsChunks, this.globalConfig.driftEnv diff --git a/src/bots/pythLazerCranker.ts b/src/bots/pythLazerCranker.ts index b1a7ba04..274570a4 100644 --- a/src/bots/pythLazerCranker.ts +++ b/src/bots/pythLazerCranker.ts @@ -78,11 +78,11 @@ export class PythLazerCrankerBot implements Bot { const feedIdChunks = chunks(Array.from(allFeedIdsSet), 11); console.log(feedIdChunks); - if (!this.globalConfig.lazerEndpoint || !this.globalConfig.lazerToken) { + if (!this.globalConfig.lazerEndpoints || !this.globalConfig.lazerToken) { throw new Error('Missing lazerEndpoint or lazerToken in global config'); } this.pythLazerClient = new PythLazerSubscriber( - this.globalConfig.lazerEndpoint, + this.globalConfig.lazerEndpoints, this.globalConfig.lazerToken, feedIdChunks, this.globalConfig.driftEnv diff --git a/src/config.ts b/src/config.ts index 8298c2db..cd904501 100644 --- a/src/config.ts +++ b/src/config.ts @@ -158,7 +158,7 @@ export interface GlobalConfig { /// ws endpoint to use (inferred from endpoint using web3.js rules, only provide if you want to use a different one) wsEndpoint?: string; hermesEndpoint?: string; - lazerEndpoint?: string; + lazerEndpoints?: string[]; lazerToken?: string; // Optional to specify markets loaded by drift client diff --git a/src/experimental-bots/filler/fillerMultithreaded.ts b/src/experimental-bots/filler/fillerMultithreaded.ts index 3b7e888b..73c7f822 100644 --- a/src/experimental-bots/filler/fillerMultithreaded.ts +++ b/src/experimental-bots/filler/fillerMultithreaded.ts @@ -403,8 +403,8 @@ export class FillerMultithreaded { }); // Pyth lazer: remember to remove devnet guard - if (!this.globalConfig.lazerEndpoint || !this.globalConfig.lazerToken) { - throw new Error('Missing lazerEndpoint or lazerToken in global config'); + if (!this.globalConfig.lazerEndpoints || !this.globalConfig.lazerToken) { + throw new Error('Missing lazerEndpoints or lazerToken in global config'); } const markets = PerpMarkets[this.globalConfig.driftEnv!] @@ -415,7 +415,7 @@ export class FillerMultithreaded { const pythLazerIds = markets.map((m) => m.pythLazerId!); const pythLazerIdsChunks = chunks(pythLazerIds, 3); this.pythLazerSubscriber = new PythLazerSubscriber( - this.globalConfig.lazerEndpoint, + this.globalConfig.lazerEndpoints, this.globalConfig.lazerToken, pythLazerIdsChunks, this.globalConfig.driftEnv diff --git a/src/pythLazerSubscriber.ts b/src/pythLazerSubscriber.ts index 345744a4..f1422562 100644 --- a/src/pythLazerSubscriber.ts +++ b/src/pythLazerSubscriber.ts @@ -15,7 +15,7 @@ export class PythLazerSubscriber { marketIndextoPriceFeedIdChunk: Map = new Map(); constructor( - private endpoint: string, + private endpoints: string[], private token: string, private priceFeedIdsArrays: number[][], env: DriftEnv = 'devnet', @@ -39,7 +39,7 @@ export class PythLazerSubscriber { async subscribe() { this.pythLazerClient = await PythLazerClient.create( - [this.endpoint], + this.endpoints, this.token ); let subscriptionId = 1; diff --git a/yarn.lock b/yarn.lock index 7938c613..db4bb2d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -175,20 +175,20 @@ enabled "2.0.x" kuler "^2.0.0" -"@drift-labs/jit-proxy@0.12.98": - version "0.12.98" - resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.12.98.tgz#9909f970180e1a65ebb0de89853fa0b8ed80da44" - integrity sha512-hn9DprQLaboiGl9/CZcl4hSXPuSYGAMcPXqwKmJoMIQnwqNffH1FrjlVtL/6rbtLSIn8NmXEnP/sBle6rlDV9A== +"@drift-labs/jit-proxy@0.13.4": + version "0.13.4" + resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.13.4.tgz#bd7389eb92afad4a095af49307f8024dd75dbe0f" + integrity sha512-Zo8qjADrSMesrvCk9QKLi6UKC31R57il955cSbEgQwkV/QbiMHZfqONnYLdPiCgGGW/GXS52EMSY+0b74NWpzQ== dependencies: "@coral-xyz/anchor" "0.26.0" - "@drift-labs/sdk" "2.110.0-beta.3" + "@drift-labs/sdk" "2.110.0-beta.5" "@solana/web3.js" "1.91.7" tweetnacl-util "^0.15.1" -"@drift-labs/sdk@2.110.0-beta.3": - version "2.110.0-beta.3" - resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.110.0-beta.3.tgz#d42f8a6626a41ed15671adc0c3a579acd4c004d1" - integrity sha512-8JwwcwYFRGTSr8i9bOECyxhGGAwUc9xqvEI1T399asAqUrZ8NxIMVndgM5gv3rFyr2oyMimfQubWiaLmq+yFCA== +"@drift-labs/sdk@2.110.0-beta.5": + version "2.110.0-beta.5" + resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.110.0-beta.5.tgz#c4398b1c01f0d8fba545939f08ff555117a69107" + integrity sha512-pKIuhC/W5slKMXdUwbKGdLYJd7GEPhfkVrvY/VkOIbuzQd4o0LG3LLDCy66BmckVJaxu6AMbg+REtI6xhsLaPg== dependencies: "@coral-xyz/anchor" "0.29.0" "@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1"