Skip to content

Commit

Permalink
shotgun: repeat for whole auction duration
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Jan 26, 2024
1 parent 2176a72 commit f26797d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ts/sdk/src/jitter/jitterShotgun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,20 @@ export class JitterShotgun extends BaseJitter {
): () => Promise<void> {
return async () => {
let i = 0;
while (i < 10) {

const takerStats = await this.userStatsMap.mustGet(
taker.authority.toString()
);
const referrerInfo = takerStats.getReferrerInfo();

// assumes each preflight simulation takes ~1 slot
while (i < order.auctionDuration) {
const params = this.perpParams.get(order.marketIndex);
if (!params) {
this.deleteOnGoingAuction(orderSignature);
return;
}

const takerStats = await this.userStatsMap.mustGet(
taker.authority.toString()
);
const referrerInfo = takerStats.getReferrerInfo();

const txParams = {
computeUnits: this.computeUnits,
computeUnitsPrice: this.computeUnitsPrice,
Expand All @@ -76,7 +78,7 @@ export class JitterShotgun extends BaseJitter {
txParams
);

console.log(`Filled ${orderSignature} txSig ${txSig}`);
console.log(`Successfully sent tx for ${orderSignature} txSig ${txSig}`);
await sleep(10000);
this.deleteOnGoingAuction(orderSignature);
return;
Expand All @@ -94,7 +96,6 @@ export class JitterShotgun extends BaseJitter {
return;
}
}
await sleep(200);
i++;
}

Expand Down

0 comments on commit f26797d

Please sign in to comment.