fix drift client
This commit is contained in:
37
src/index.ts
37
src/index.ts
@@ -166,21 +166,22 @@ const main = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const bulkAccountLoader = new BulkAccountLoader(
|
const bulkAccountLoader = new BulkAccountLoader(
|
||||||
connection,
|
connection,
|
||||||
stateCommitment,
|
stateCommitment,
|
||||||
ORDERBOOK_UPDATE_INTERVAL
|
ORDERBOOK_UPDATE_INTERVAL
|
||||||
),
|
);
|
||||||
driftClient = new DriftClient({
|
|
||||||
connection,
|
driftClient = new DriftClient({
|
||||||
wallet,
|
connection,
|
||||||
programID: clearingHousePublicKey,
|
wallet,
|
||||||
accountSubscription: {
|
programID: clearingHousePublicKey,
|
||||||
type: 'polling',
|
accountSubscription: {
|
||||||
accountLoader: bulkAccountLoader,
|
type: 'polling',
|
||||||
},
|
accountLoader: bulkAccountLoader,
|
||||||
env: driftEnv,
|
},
|
||||||
userStats: true,
|
env: driftEnv,
|
||||||
});
|
userStats: true,
|
||||||
|
});
|
||||||
|
|
||||||
const dlobCoder = DLOBOrdersCoder.create();
|
const dlobCoder = DLOBOrdersCoder.create();
|
||||||
const slotSubscriber = new SlotSubscriber(connection, {});
|
const slotSubscriber = new SlotSubscriber(connection, {});
|
||||||
@@ -213,7 +214,11 @@ const main = async () => {
|
|||||||
await userMap.subscribe();
|
await userMap.subscribe();
|
||||||
const userStatsMap = new UserStatsMap(driftClient, {
|
const userStatsMap = new UserStatsMap(driftClient, {
|
||||||
type: 'polling',
|
type: 'polling',
|
||||||
accountLoader: bulkAccountLoader,
|
accountLoader: new BulkAccountLoader(
|
||||||
|
connection,
|
||||||
|
stateCommitment,
|
||||||
|
ORDERBOOK_UPDATE_INTERVAL * 10
|
||||||
|
),
|
||||||
});
|
});
|
||||||
await userStatsMap.subscribe();
|
await userStatsMap.subscribe();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user