Skip to content

Commit

Permalink
Merge pull request #359 from drift-labs/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
NourAlharithi authored Jan 29, 2025
2 parents 9a900ea + 55fb6d9 commit b4d1e33
Show file tree
Hide file tree
Showing 6 changed files with 40 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.73",
"@drift-labs/sdk": "2.108.0-beta.10",
"@drift-labs/jit-proxy": "0.12.74",
"@drift-labs/sdk": "2.108.0-beta.11",
"@opentelemetry/api": "1.7.0",
"@opentelemetry/auto-instrumentations-node": "0.31.2",
"@opentelemetry/exporter-prometheus": "0.31.0",
Expand Down
19 changes: 12 additions & 7 deletions src/experimental-bots/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,18 @@ const runBot = async () => {
});
await userMap.subscribe();

const swiftMaker = new SwiftMaker(driftClient, userMap, {
rpcEndpoint: endpoint,
commit: '',
driftEnv: config.global.driftEnv!,
driftPid: driftPublicKey.toBase58(),
walletAuthority: wallet.publicKey.toBase58(),
});
const swiftMaker = new SwiftMaker(
driftClient,
userMap,
{
rpcEndpoint: endpoint,
commit: '',
driftEnv: config.global.driftEnv!,
driftPid: driftPublicKey.toBase58(),
walletAuthority: wallet.publicKey.toBase58(),
},
config.global.testLiveness
);
bots.push(swiftMaker);
}

Expand Down
2 changes: 1 addition & 1 deletion src/experimental-bots/filler/fillerMultithreaded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export class FillerMultithreaded {
)
.filter((market) => market.pythLazerId !== undefined);
const pythLazerIds = markets.map((m) => m.pythLazerId!);
const pythLazerIdsChunks = chunks(pythLazerIds, 6);
const pythLazerIdsChunks = chunks(pythLazerIds, 3);
this.pythLazerSubscriber = new PythLazerSubscriber(
this.globalConfig.lazerEndpoint,
this.globalConfig.lazerToken,
Expand Down
8 changes: 7 additions & 1 deletion src/experimental-bots/swift/makerExample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export class SwiftMaker {
constructor(
private driftClient: DriftClient,
private userMap: UserMap,
runtimeSpec: RuntimeSpec
runtimeSpec: RuntimeSpec,
private dryRun?: boolean
) {
if (runtimeSpec.driftEnv != 'devnet') {
throw new Error('SwiftMaker only works on devnet');
Expand Down Expand Up @@ -187,8 +188,13 @@ export class SwiftMaker {
);
if (resp.value.err) {
console.log(resp.value.logs);
return;
}

if (this.dryRun) {
console.log('Dry run, not sending transaction');
return;
}
this.driftClient.txSender
.sendVersionedTransaction(tx)
.then((response) => {
Expand Down
12 changes: 9 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
OpenbookV2FulfillmentConfigAccount,
OpenbookV2Subscriber,
OracleInfo,
PYTH_LAZER_STORAGE_ACCOUNT_KEY,
} from '@drift-labs/sdk';
import {
NATIVE_MINT,
Expand Down Expand Up @@ -1383,9 +1384,14 @@ export function removePythIxs(
): TransactionInstruction[] {
return ixs.filter(
(ix) =>
!ix.keys
.map((meta) => meta.pubkey.toString())
.includes(receiverPublicKeyStr)
!(
ix.keys
.map((meta) => meta.pubkey.toString())
.includes(receiverPublicKeyStr) ||
ix.keys
.map((meta) => meta.pubkey.toString())
.includes(PYTH_LAZER_STORAGE_ACCOUNT_KEY.toString())
)
);
}

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.73":
version "0.12.73"
resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.12.73.tgz#1939da29bfb4966b4df5d6009c58e6c52965f86a"
integrity sha512-Z4iT5TFZxlua3qIsO/AxBIg+wJa7ZkqMACdp6Zq31q74I2Kt7ilhAXKCvNEuuoXXqOm3PFmYRgJvdCypBiSl7w==
"@drift-labs/jit-proxy@0.12.74":
version "0.12.74"
resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.12.74.tgz#093ecc82f8f4e0ffdf452382236636f92c46e3c3"
integrity sha512-BLlIuhT5lM1nFCee1N6k1nObdCf83aWrnU1E+VQONtu4FuWIwi3YZoIdNewvcwO960AmOzuTDxKPALyDWR7YcA==
dependencies:
"@coral-xyz/anchor" "0.26.0"
"@drift-labs/sdk" "2.108.0-beta.10"
"@drift-labs/sdk" "2.108.0-beta.11"
"@solana/web3.js" "1.91.7"
tweetnacl-util "^0.15.1"

"@drift-labs/sdk@2.108.0-beta.10":
version "2.108.0-beta.10"
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.108.0-beta.10.tgz#464a7ca5143df88e14b68dd34479c6e1a8fa5005"
integrity sha512-t6mpooky+Qw28mOcENnDSYdcumjP6p77krbds+wg8wT4jHdVLBk8eyJH2Jc898GVJMC2iq2HozvHYjAHb16yxw==
"@drift-labs/sdk@2.108.0-beta.11":
version "2.108.0-beta.11"
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.108.0-beta.11.tgz#41a3a32c6fe58fbb97b7e4570664ab174a63f8fe"
integrity sha512-/p2uusjnp/Vwos0IfK4jskgriwgbD7GtzhU2ahdDnwZJwrgcm0cyG/Sx+vWw9ZD1AWy724VGNI+6PYEB0pmy2A==
dependencies:
"@coral-xyz/anchor" "0.29.0"
"@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1"
Expand Down

0 comments on commit b4d1e33

Please sign in to comment.