Skip to content

Commit 7ad8558

Browse files
committed
feat(frontend): increase ICPSwap minimum TVL threshold to 500 USD
Tokens like USDC have ICPSwap pools with low TVL whose prices are unreliable. Raise the cutoff from 10 to 500 USD so we fall through to "no fallback price" instead of feeding bad rates to the user.
1 parent a2da16f commit 7ad8558

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/frontend/src/lib/utils/exchange.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const usdValue = ({
3131
) * exchangeRate
3232
: Number(ZERO);
3333

34-
const ICPSWAP_MIN_TVL_USD = 10;
34+
const ICPSWAP_MIN_TVL_USD = 500;
3535

3636
export const formatIcpSwapToCoingeckoPrices = (
3737
tokens: IcpSwapToken[]

src/frontend/src/tests/lib/utils/exchange.utils.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('exchange.utils', () => {
7272
it('skips token where tvlUSD is exactly at the threshold', () => {
7373
const mock = createMockIcpSwapToken({
7474
price: '1.230000000000000000',
75-
tvlUSD: '10.000000000000000000'
75+
tvlUSD: '500.000000000000000000'
7676
});
7777
const result = formatIcpSwapToCoingeckoPrices([mock]);
7878

@@ -83,7 +83,7 @@ describe('exchange.utils', () => {
8383
const mock = createMockIcpSwapToken({
8484
tokenLedgerId: MOCK_CANISTER_ID_1,
8585
price: '1.230000000000000000',
86-
tvlUSD: '10.010000000000000000'
86+
tvlUSD: '500.010000000000000000'
8787
});
8888
const result = formatIcpSwapToCoingeckoPrices([mock]);
8989

0 commit comments

Comments
 (0)