Skip to content

Commit 0abf952

Browse files
authored
Merge pull request #412 from drift-labs/master
rename fastlane -> swift
2 parents 3406bc6 + 9bc678e commit 0abf952

File tree

10 files changed

+58
-59
lines changed

10 files changed

+58
-59
lines changed

.github/workflows/master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ jobs:
6767
kubectl rollout restart -n $BRANCH_NAME deployment/pyth-cranker-bot
6868
kubectl rollout restart -n $BRANCH_NAME deployment/pyth-lazer-cranker-bot
6969
kubectl rollout restart -n $BRANCH_NAME deployment/switchboard-cranker-bot
70-
kubectl rollout restart -n $BRANCH_NAME deployment/fastlane-taker-example-bot
71-
kubectl rollout restart -n $BRANCH_NAME deployment/fastlane-maker-example-bot
70+
kubectl rollout restart -n $BRANCH_NAME deployment/swift-taker-example-bot
71+
kubectl rollout restart -n $BRANCH_NAME deployment/swift-maker-example-bot

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "lib/index.js",
66
"license": "Apache-2.0",
77
"dependencies": {
8-
"@drift-labs/jit-proxy": "0.13.61",
9-
"@drift-labs/sdk": "2.113.0-beta.1",
8+
"@drift-labs/jit-proxy": "0.13.66",
9+
"@drift-labs/sdk": "2.113.0-beta.5",
1010
"@opentelemetry/api": "1.7.0",
1111
"@opentelemetry/auto-instrumentations-node": "0.31.2",
1212
"@opentelemetry/exporter-prometheus": "0.31.0",

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ export type BotConfigMap = {
147147
pythCranker?: PythCrankerBotConfig;
148148
pythLazerCranker?: PythLazerCrankerBotConfig;
149149
switchboardCranker?: SwitchboardCrankerBotConfig;
150-
fastlaneTaker?: BaseBotConfig;
151-
fastlaneMaker?: BaseBotConfig;
150+
swiftTaker?: BaseBotConfig;
151+
swiftMaker?: BaseBotConfig;
152152
jitMaker?: JitMakerConfig;
153153
};
154154

src/experimental-bots/entrypoint.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import { promiseTimeout } from '@drift-labs/sdk';
3737
import { SpotFillerMultithreaded } from './spotFiller/spotFillerMultithreaded';
3838
import { setGlobalDispatcher, Agent } from 'undici';
3939
import { PythPriceFeedSubscriber } from '../pythPriceFeedSubscriber';
40-
import { FastlaneMaker } from './fastlane/makerExample';
41-
import { FastlaneTaker } from './fastlane/takerExample';
40+
import { SwiftMaker } from './swift/makerExample';
41+
import { SwiftTaker } from './swift/takerExample';
4242
import * as net from 'net';
4343

4444
setGlobalDispatcher(
@@ -376,7 +376,7 @@ const runBot = async () => {
376376
bots.push(spotFillerMultithreaded);
377377
}
378378

379-
if (configHasBot(config, 'fastlaneMaker')) {
379+
if (configHasBot(config, 'swiftMaker')) {
380380
const userMap = new UserMap({
381381
connection,
382382
driftClient,
@@ -388,7 +388,7 @@ const runBot = async () => {
388388
});
389389
await userMap.subscribe();
390390

391-
const signedMsgMaker = new FastlaneMaker(
391+
const signedMsgMaker = new SwiftMaker(
392392
driftClient,
393393
userMap,
394394
{
@@ -403,8 +403,8 @@ const runBot = async () => {
403403
bots.push(signedMsgMaker);
404404
}
405405

406-
if (configHasBot(config, 'fastlaneTaker')) {
407-
const signedMsgMaker = new FastlaneTaker(
406+
if (configHasBot(config, 'swiftTaker')) {
407+
const signedMsgMaker = new SwiftTaker(
408408
driftClient,
409409
{
410410
rpcEndpoint: endpoint,

src/experimental-bots/filler-common/fastlaneOrderSubscriber.ts renamed to src/experimental-bots/filler-common/swiftOrderSubscriber.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ import { sleepMs } from '../../utils';
1212
import dotenv from 'dotenv';
1313
import parseArgs from 'minimist';
1414

15-
export type FastlaneOrderSubscriberConfig = {
15+
export type SwiftOrderSubscriberConfig = {
1616
driftEnv: DriftEnv;
1717
endpoint: string;
1818
marketIndexes: number[];
1919
keypair: Keypair;
2020
};
2121

22-
export class FastlaneOrderSubscriber {
22+
export class SwiftOrderSubscriber {
2323
private heartbeatTimeout: NodeJS.Timeout | null = null;
2424
private readonly heartbeatIntervalMs = 60000;
2525
private ws: WebSocket | null = null;
2626
subscribed: boolean = false;
2727

28-
constructor(private config: FastlaneOrderSubscriberConfig) {}
28+
constructor(private config: SwiftOrderSubscriberConfig) {}
2929

3030
getSymbolForMarketIndex(marketIndex: number) {
3131
const markets =
@@ -174,20 +174,20 @@ async function main() {
174174
}
175175

176176
const keypair = loadKeypair(privateKey);
177-
const fastlaneOrderSubscriberConfig: FastlaneOrderSubscriberConfig = {
177+
const swiftOrderSubscriberConfig: SwiftOrderSubscriberConfig = {
178178
driftEnv,
179179
endpoint:
180180
driftEnv === 'devnet'
181-
? 'wss://master.fastlane.drift.trade/ws'
182-
: 'wss://fastlane.drift.trade/ws',
181+
? 'wss://master.swift.drift.trade/ws'
182+
: 'wss://swift.drift.trade/ws',
183183
marketIndexes,
184184
keypair,
185185
};
186186

187-
const fastlaneOrderSubscriber = new FastlaneOrderSubscriber(
188-
fastlaneOrderSubscriberConfig
187+
const swiftOrderSubscriber = new SwiftOrderSubscriber(
188+
swiftOrderSubscriberConfig
189189
);
190-
await fastlaneOrderSubscriber.subscribe();
190+
await swiftOrderSubscriber.subscribe();
191191
}
192192

193193
main();

src/experimental-bots/filler/fillerMultithreaded.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class FillerMultithreaded {
197197

198198
private dlobHealthy = true;
199199
private orderSubscriberHealthy = true;
200-
private fastlaneOrderSubscriberHealth = true;
200+
private swiftOrderSubscriberHealth = true;
201201
private simulateTxForCUEstimate?: boolean;
202202

203203
// SignedMsg orders
@@ -598,17 +598,17 @@ export class FillerMultithreaded {
598598
);
599599

600600
// SignedMsg Subscriber process
601-
const fastlaneOrderSubscriberFileName =
602-
'fastlaneOrderSubscriber' + (isTsRuntime() ? '.ts' : '.js');
603-
const fastlaneOrderSubscriberProcess = spawnChild(
601+
const swiftOrderSubscriberFileName =
602+
'swiftOrderSubscriber' + (isTsRuntime() ? '.ts' : '.js');
603+
const swiftOrderSubscriberProcess = spawnChild(
604604
path.join(
605605
__dirname,
606606
isTsRuntime() ? '..' : '.',
607607
'filler-common',
608-
fastlaneOrderSubscriberFileName
608+
swiftOrderSubscriberFileName
609609
),
610610
orderSubscriberArgs,
611-
'fastlaneOrderSubscriber',
611+
'swiftOrderSubscriber',
612612
(msg: any) => {
613613
switch (msg.type) {
614614
case 'signedMsgOrderParamsMessage':
@@ -623,14 +623,14 @@ export class FillerMultithreaded {
623623
}
624624
break;
625625
case 'health':
626-
this.fastlaneOrderSubscriberHealth = msg.data.healthy;
626+
this.swiftOrderSubscriberHealth = msg.data.healthy;
627627
break;
628628
}
629629
}
630630
);
631631

632-
fastlaneOrderSubscriberProcess.on('exit', (code) => {
633-
logger.error(`fastlaneOrderSubscriber exited with code ${code}`);
632+
swiftOrderSubscriberProcess.on('exit', (code) => {
633+
logger.error(`swiftOrderSubscriber exited with code ${code}`);
634634
process.exit(code || 1);
635635
});
636636

@@ -640,12 +640,12 @@ export class FillerMultithreaded {
640640
value.process.kill();
641641
});
642642
orderSubscriberProcess.kill();
643-
fastlaneOrderSubscriberProcess.kill();
643+
swiftOrderSubscriberProcess.kill();
644644
process.exit(0);
645645
});
646646

647647
logger.info(
648-
`fastlaneOrderSubscriber process spawned with pid: ${fastlaneOrderSubscriberProcess.pid}`
648+
`swiftOrderSubscriber process spawned with pid: ${swiftOrderSubscriberProcess.pid}`
649649
);
650650

651651
this.intervalIds.push(
@@ -837,13 +837,13 @@ export class FillerMultithreaded {
837837
if (!this.orderSubscriberHealthy) {
838838
logger.error(`${logPrefix} Order subscriber not healthy`);
839839
}
840-
if (!this.fastlaneOrderSubscriberHealth) {
840+
if (!this.swiftOrderSubscriberHealth) {
841841
logger.error(`${logPrefix} SignedMsg order subscriber not healthy`);
842842
}
843843
return (
844844
this.dlobHealthy &&
845845
this.orderSubscriberHealthy &&
846-
this.fastlaneOrderSubscriberHealth
846+
this.swiftOrderSubscriberHealth
847847
);
848848
}
849849

src/experimental-bots/fastlane/makerExample.ts renamed to src/experimental-bots/swift/makerExample.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from '@solana/web3.js';
2525
import { getPriorityFeeInstruction } from '../filler-common/utils';
2626

27-
export class FastlaneMaker {
27+
export class SwiftMaker {
2828
interval: NodeJS.Timeout | null = null;
2929
private ws: WebSocket | null = null;
3030
private signedMsgUrl: string;
@@ -39,8 +39,8 @@ export class FastlaneMaker {
3939
) {
4040
this.signedMsgUrl =
4141
runtimeSpec.driftEnv === 'mainnet-beta'
42-
? 'wss://fastlane.drift.trade/ws'
43-
: 'wss://master.fastlane.drift.trade/ws';
42+
? 'wss://swift.drift.trade/ws'
43+
: 'wss://master.swift.drift.trade/ws';
4444

4545
const perpMarketsToWatchForFees = [0, 1, 2, 3, 4, 5].map((x) => {
4646
return { marketType: 'perp', marketIndex: x };

src/experimental-bots/fastlane/takerExample.ts renamed to src/experimental-bots/swift/takerExample.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ import { sleepMs } from '../../utils';
1414

1515
const CONFIRM_TIMEOUT = 30_000;
1616

17-
export class FastlaneTaker {
17+
export class SwiftTaker {
1818
interval: NodeJS.Timeout | null = null;
19-
fastlaneUrl: string;
19+
swiftUrl: string;
2020

2121
constructor(
2222
private driftClient: DriftClient,
2323
runtimeSpec: RuntimeSpec,
2424
private intervalMs: number
2525
) {
26-
this.fastlaneUrl =
26+
this.swiftUrl =
2727
runtimeSpec.driftEnv === 'mainnet-beta'
28-
? 'https://fastlane.drift.trade'
29-
: 'https://master.fastlane.drift.trade';
28+
? 'https://swift.drift.trade'
29+
: 'https://master.swift.drift.trade';
3030
}
3131

3232
async init() {
@@ -82,7 +82,7 @@ export class FastlaneTaker {
8282
);
8383

8484
const response = await axios.default.post(
85-
this.fastlaneUrl + '/orders',
85+
this.swiftUrl + '/orders',
8686
{
8787
market_index: marketIndex,
8888
market_type: 'perp',
@@ -104,7 +104,7 @@ export class FastlaneTaker {
104104
const expireTime = Date.now() + CONFIRM_TIMEOUT;
105105
while (Date.now() < expireTime) {
106106
const response = await axios.default.get(
107-
this.fastlaneUrl +
107+
this.swiftUrl +
108108
'/confirmation/hash-status?hash=' +
109109
encodeURIComponent(hash),
110110
{

src/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
PerpMarkets,
3939
configs,
4040
AuctionSubscriber,
41-
FastlaneOrderSubscriber,
41+
SwiftOrderSubscriber,
4242
} from '@drift-labs/sdk';
4343
import { promiseTimeout } from '@drift-labs/sdk';
4444

@@ -607,13 +607,12 @@ const runBot = async () => {
607607
driftClient,
608608
resubTimeoutMs: 30_000,
609609
});
610-
let fastlaneOrderSubscriber: FastlaneOrderSubscriber | undefined =
611-
undefined;
610+
let swiftOrderSubscriber: SwiftOrderSubscriber | undefined = undefined;
612611
if (config.global.driftEnv === 'devnet') {
613612
if (!config.botConfigs?.jitMaker?.marketIndexes) {
614613
throw new Error('Market indexes must be specified for JIT Maker bot');
615614
}
616-
fastlaneOrderSubscriber = new FastlaneOrderSubscriber({
615+
swiftOrderSubscriber = new SwiftOrderSubscriber({
617616
driftEnv: 'devnet',
618617
marketIndexes: config.botConfigs?.jitMaker?.marketIndexes,
619618
keypair: new Keypair(),
@@ -632,9 +631,9 @@ const runBot = async () => {
632631
auctionSubscriber,
633632
driftClient,
634633
jitProxyClient,
635-
fastlaneOrderSubscriber,
634+
swiftOrderSubscriber,
636635
slotSubscriber,
637-
auctionSubscriberIgnoresFastlaneOrders: !!fastlaneOrderSubscriber,
636+
auctionSubscriberIgnoresSwiftOrders: !!swiftOrderSubscriber,
638637
});
639638
await jitter.subscribe();
640639

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,20 @@
175175
enabled "2.0.x"
176176
kuler "^2.0.0"
177177

178-
"@drift-labs/[email protected].61":
179-
version "0.13.61"
180-
resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.13.61.tgz#e2fa9ebf695a08500bed6f8beb208ef1a9b8c031"
181-
integrity sha512-niACh0kawZZ46k9eiFTCJYY+xhjswRlXz2xrxHsTnInaPTWYvZ7p93Y98SaGXNRTq2m81mSX8XM4l3v0+muzjg==
178+
"@drift-labs/[email protected].66":
179+
version "0.13.66"
180+
resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.13.66.tgz#8f30822357b642cb870516471128be3657090bca"
181+
integrity sha512-eBHZ0oLOrC8V0xuczszqvRbjFBvGo6guFeXM0hrlWMOfhOes8mGGocUGD1a00jsigPpPLVCAsmVEEfqValQEpA==
182182
dependencies:
183183
"@coral-xyz/anchor" "0.26.0"
184-
"@drift-labs/sdk" "2.113.0-beta.1"
184+
"@drift-labs/sdk" "2.113.0-beta.5"
185185
"@solana/web3.js" "1.91.7"
186186
tweetnacl-util "^0.15.1"
187187

188-
"@drift-labs/[email protected].1":
189-
version "2.113.0-beta.1"
190-
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.113.0-beta.1.tgz#5262e8ff1d424cd9b4284fb87722064f5fe6daf5"
191-
integrity sha512-W2Gul59QvAemQyqckBJYIJc5fLNDv9kPs1lPxSszIS44eX/2JG55k+P6Rbf0kFKBaSwmRYvDoMYnvWzjR28iCQ==
188+
"@drift-labs/[email protected].5":
189+
version "2.113.0-beta.5"
190+
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.113.0-beta.5.tgz#6a9882f58a5dbf719016b8020aac0481856dc8ec"
191+
integrity sha512-Cg6Ib89GJ5zBFnS3xXlY0f0ZMfQ754BF7Utll1kx4xpvW6mK3Nt+XuwoUjTifQyT52vhr8WdrL5/NvokjvwTTg==
192192
dependencies:
193193
"@coral-xyz/anchor" "0.29.0"
194194
"@coral-xyz/anchor-30" "npm:@coral-xyz/[email protected]"

0 commit comments

Comments
 (0)