This commit is contained in:
Nour Alharithi
2023-11-11 09:28:19 -08:00
parent 384e785371
commit bd520a4c62

View File

@@ -165,13 +165,18 @@ const main = async () => {
commitment: stateCommitment,
});
const bulkAccountLoader = new BulkAccountLoader(
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL * 10
),
driftClient = new DriftClient({
connection,
wallet,
programID: clearingHousePublicKey,
accountSubscription: {
type: 'websocket',
resubTimeoutMs: 60000,
type: 'polling',
accountLoader: bulkAccountLoader,
},
env: driftEnv,
userStats: true,
@@ -208,11 +213,7 @@ const main = async () => {
await userMap.subscribe();
const userStatsMap = new UserStatsMap(driftClient, {
type: 'polling',
accountLoader: new BulkAccountLoader(
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL * 10
),
accountLoader: bulkAccountLoader,
});
await userStatsMap.subscribe();