Skip to content

Commit

Permalink
wsPublish polls RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
NourAlharithi committed Nov 13, 2023
1 parent cda9012 commit ba4b665
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/wsPublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
SlotSubscriber,
UserMap,
Wallet,
BulkAccountLoader,
} from '@drift-labs/sdk';

import { logger, setLogLevel } from './utils/logger';
Expand Down Expand Up @@ -50,12 +51,19 @@ const main = async () => {
commitment: stateCommitment,
});

const bulkAccountLoader = new BulkAccountLoader(
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL
);

driftClient = new DriftClient({
connection,
wallet,
programID: clearingHousePublicKey,
accountSubscription: {
type: 'websocket',
type: 'polling',
accountLoader: bulkAccountLoader,
},
env: driftEnv,
userStats: true,
Expand Down

0 comments on commit ba4b665

Please sign in to comment.