From ce72fa89bb2f5dc62e988d1cbe19832337b4e5fb Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 9 Dec 2024 19:46:45 +0300 Subject: [PATCH] add fix --- src/dex/stader/stader.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dex/stader/stader.ts b/src/dex/stader/stader.ts index 188abbba1..e883dd492 100644 --- a/src/dex/stader/stader.ts +++ b/src/dex/stader/stader.ts @@ -104,6 +104,7 @@ export class Stader isFirstSwap?: boolean | undefined, ): Promise | null> { if (side === SwapSide.BUY) return null; + if (!this.isEligibleSwap(srcToken, destToken)) return null; const pool = this.ethxPool; if (!pool.getState(blockNumber)) return null; @@ -127,11 +128,7 @@ export class Stader ]; } - isEligibleSwap( - srcToken: Token | string, - destToken: Token | string, - side: SwapSide, - ): boolean { + isEligibleSwap(srcToken: Token | string, destToken: Token | string): boolean { const srcTokenAddress = ( typeof srcToken === 'string' ? srcToken : srcToken.address ).toLowerCase(); @@ -189,7 +186,7 @@ export class Stader ): Promise { if (side === SwapSide.BUY) return []; - if (!this.isEligibleSwap(srcToken, destToken, side)) return []; + if (!this.isEligibleSwap(srcToken, destToken)) return []; return [`${ETHER_ADDRESS}_${destToken.address}`.toLowerCase()]; }