Skip to content

Commit

Permalink
add fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Dec 9, 2024
1 parent 8a4e2e3 commit ce72fa8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/dex/stader/stader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class Stader
isFirstSwap?: boolean | undefined,
): Promise<ExchangePrices<StaderData> | null> {
if (side === SwapSide.BUY) return null;
if (!this.isEligibleSwap(srcToken, destToken)) return null;

const pool = this.ethxPool;
if (!pool.getState(blockNumber)) return null;
Expand All @@ -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();
Expand Down Expand Up @@ -189,7 +186,7 @@ export class Stader
): Promise<string[]> {
if (side === SwapSide.BUY) return [];

if (!this.isEligibleSwap(srcToken, destToken, side)) return [];
if (!this.isEligibleSwap(srcToken, destToken)) return [];

return [`${ETHER_ADDRESS}_${destToken.address}`.toLowerCase()];
}
Expand Down

0 comments on commit ce72fa8

Please sign in to comment.