Skip to content

Commit

Permalink
ts: jitters account for new error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Jan 24, 2024
1 parent a9a397f commit 249bd97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ts/sdk/src/jitter/jitterShotgun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ export class JitterShotgun extends BaseJitter {
console.error(`Failed to fill ${orderSignature}`);
if (e.message.includes('0x1770') || e.message.includes('0x1771')) {
console.log('Order does not cross params yet, retrying');
} else if (e.message.includes('0x1793')) {
} else if (e.message.includes('0x1779')) {
console.log('Order could not fill');
} else if (e.message.includes('0x1793')) {
console.log('Oracle invalid, retrying');
} else {
await sleep(10000);
this.onGoingAuctions.delete(orderSignature);
return;
}
}
await sleep(200);
i++;
}

Expand Down
6 changes: 4 additions & 2 deletions ts/sdk/src/jitter/jitterSniper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class JitterSniper extends BaseJitter {
)}
`);
let i = 0;
while (i < 3) {
while (i < 10) {
try {
const txParams = {
computeUnits: this.computeUnits,
Expand Down Expand Up @@ -215,6 +215,8 @@ export class JitterSniper extends BaseJitter {
console.error(`Failed to fill ${orderSignature}`);
if (e.message.includes('0x1770') || e.message.includes('0x1771')) {
console.log('Order does not cross params yet');
} else if (e.message.includes('0x1779')) {
console.log('Order could not fill');
} else if (e.message.includes('0x1793')) {
console.log('Oracle invalid');
} else {
Expand All @@ -223,7 +225,7 @@ export class JitterSniper extends BaseJitter {
return;
}
}
await sleep(50);
await sleep(200);
i++;
}
});
Expand Down

0 comments on commit 249bd97

Please sign in to comment.