Skip to content

Commit

Permalink
Merge pull request #381 from drift-labs/master
Browse files Browse the repository at this point in the history
lazer endpoints config
  • Loading branch information
NourAlharithi authored Feb 11, 2025
2 parents 01258c9 + 028f8a0 commit a4fb99a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/bots/filler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/bots/makerBidAskTwapCrank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/bots/pythLazerCranker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/experimental-bots/filler/fillerMultithreaded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!]
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/pythLazerSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class PythLazerSubscriber {
marketIndextoPriceFeedIdChunk: Map<number, number[]> = new Map();

constructor(
private endpoint: string,
private endpoints: string[],
private token: string,
private priceFeedIdsArrays: number[][],
env: DriftEnv = 'devnet',
Expand All @@ -39,7 +39,7 @@ export class PythLazerSubscriber {

async subscribe() {
this.pythLazerClient = await PythLazerClient.create(
[this.endpoint],
this.endpoints,
this.token
);
let subscriptionId = 1;
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a4fb99a

Please sign in to comment.