Skip to content

Commit

Permalink
fixed compare by tvl fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Feb 8, 2024
1 parent 26a8cde commit 9816c48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/utils/comparePoolByTvl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export const comparePoolByTvl = (poolA: AmmPool, poolB: AmmPool): number => {
return 1;
}

if (!poolA.tvl && !poolB.tvl) {
return Number(
poolB.x.amount * poolB.y.amount - poolA.x.amount * poolA.y.amount,
);
}

if (!poolA.tvl) {
return 1;
}
Expand Down

0 comments on commit 9816c48

Please sign in to comment.