Skip to content

Commit

Permalink
sort amms data
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesfracari committed Jun 18, 2024
1 parent c32308d commit 688b493
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/cow-amm-deployer/src/components/TokenAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function TokenAmount({
{formatNumber(balance, 4)} {token.symbol}
</span>
<span className="flex flex-row gap-1 text-sm text-background/50">
${formatNumber(balance * usdPrice, 4)}
${formatNumber(balance * usdPrice, 2)}
{usdPrice ? null : <PriceErrorTooltip />}
</span>
</div>
Expand Down
8 changes: 7 additions & 1 deletion apps/cow-amm-deployer/src/lib/fetchAmmData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,5 +316,11 @@ export const fetchUserAmmsData = async (userId: string): Promise<ICowAmm[]> => {
constantProductDatas.items.map((amm) => getAmmData(amm)),
)) as ICowAmm[];

return allAmms.filter((amm) => amm.version === "Standalone" || !amm.disabled);
const allAmmsFiltered = allAmms.filter(
(amm) => amm.version === "Standalone" || !amm.disabled,
);

allAmmsFiltered.sort((a, b) => b.totalUsdValue - a.totalUsdValue);

return allAmmsFiltered;
};

0 comments on commit 688b493

Please sign in to comment.