From 249bd971ef3749c826414913e836d2c71e47e8a0 Mon Sep 17 00:00:00 2001 From: Chris Heaney Date: Wed, 24 Jan 2024 13:33:04 -0500 Subject: [PATCH] ts: jitters account for new error codes --- ts/sdk/src/jitter/jitterShotgun.ts | 5 ++++- ts/sdk/src/jitter/jitterSniper.ts | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ts/sdk/src/jitter/jitterShotgun.ts b/ts/sdk/src/jitter/jitterShotgun.ts index a8a1925..8389616 100644 --- a/ts/sdk/src/jitter/jitterShotgun.ts +++ b/ts/sdk/src/jitter/jitterShotgun.ts @@ -96,7 +96,9 @@ 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); @@ -104,6 +106,7 @@ export class JitterShotgun extends BaseJitter { return; } } + await sleep(200); i++; } diff --git a/ts/sdk/src/jitter/jitterSniper.ts b/ts/sdk/src/jitter/jitterSniper.ts index f01a319..17e15e7 100644 --- a/ts/sdk/src/jitter/jitterSniper.ts +++ b/ts/sdk/src/jitter/jitterSniper.ts @@ -186,7 +186,7 @@ export class JitterSniper extends BaseJitter { )} `); let i = 0; - while (i < 3) { + while (i < 10) { try { const txParams = { computeUnits: this.computeUnits, @@ -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 { @@ -223,7 +225,7 @@ export class JitterSniper extends BaseJitter { return; } } - await sleep(50); + await sleep(200); i++; } });