Skip to content

Commit 987213e

Browse files
authored
Merge pull request #497 from drift-labs/hotfix/pythcrank-chunk-1
chunk size 1 for pyth pull updates
2 parents 1ff3e97 + 37b49ee commit 987213e

File tree

3 files changed

+343
-358
lines changed

3 files changed

+343
-358
lines changed

src/bots/pythCranker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ export class PythCrankerBot implements Bot {
386386
);
387387

388388
// Pair up the feed ids to fetch vaa and update
389-
const feedIdPairs = chunks(feedIdsToUpdate, 2);
389+
const feedIdPairs = chunks(feedIdsToUpdate, 1);
390+
390391
await Promise.all(
391392
feedIdPairs.map(async (feedIds) => {
392393
const vaa = await this.getVaaForPriceFeedIds(
@@ -445,6 +446,9 @@ export class PythCrankerBot implements Bot {
445446
microLamports: priorityFees,
446447
})
447448
);
449+
450+
console.log(`feedId: ${feedIds[0]}, VAA size: ${vaa.length}`);
451+
448452
ixs.push(
449453
...(await this.driftClient.getPostPythPullOracleUpdateAtomicIxs(
450454
vaa,

src/bots/userPnlSettler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ export class UserPnlSettlerBot implements Bot {
198198
if (this.runOnce) {
199199
await this.trySettleNegativePnl();
200200
await this.trySettleUsersWithNoPositions();
201-
await this.trySettlePositivePnlForLowMargin();
201+
await this.trySettlePositivePnlForLowMargin();
202202
} else {
203203
// Initial settlement
204204
await this.trySettleNegativePnl();
205205
await this.trySettleUsersWithNoPositions();
206-
await this.trySettlePositivePnlForLowMargin();
206+
await this.trySettlePositivePnlForLowMargin();
207207

208208
// Set up intervals
209209
this.intervalIds.push(

0 commit comments

Comments
 (0)