Skip to content

Commit

Permalink
fix drift client
Browse files Browse the repository at this point in the history
  • Loading branch information
NourAlharithi committed Nov 11, 2023
1 parent d189525 commit 76d9791
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,22 @@ const main = async () => {
});

const bulkAccountLoader = new BulkAccountLoader(
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL
),
driftClient = new DriftClient({
connection,
wallet,
programID: clearingHousePublicKey,
accountSubscription: {
type: 'polling',
accountLoader: bulkAccountLoader,
},
env: driftEnv,
userStats: true,
});
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL
);

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

const dlobCoder = DLOBOrdersCoder.create();
const slotSubscriber = new SlotSubscriber(connection, {});
Expand Down Expand Up @@ -213,7 +214,11 @@ const main = async () => {
await userMap.subscribe();
const userStatsMap = new UserStatsMap(driftClient, {
type: 'polling',
accountLoader: bulkAccountLoader,
accountLoader: new BulkAccountLoader(
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL * 10
),
});
await userStatsMap.subscribe();

Expand Down

0 comments on commit 76d9791

Please sign in to comment.