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