From 383fba96d8046de8c1bc0d3c683aa8262310282b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezi=C5=84ski?= Date: Mon, 25 Sep 2023 20:11:01 +0200 Subject: [PATCH] fix usdc decoding in mango edit (#1837) --- components/instructions/programs/mangoV4.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/instructions/programs/mangoV4.tsx b/components/instructions/programs/mangoV4.tsx index e8d9e0778f..92dfb74ca0 100644 --- a/components/instructions/programs/mangoV4.tsx +++ b/components/instructions/programs/mangoV4.tsx @@ -1,6 +1,7 @@ import { MANGO_V4_ID, MangoClient, + USDC_MINT, toUiDecimals, } from '@blockworks-foundation/mango-v4' import AdvancedOptionsDropdown from '@components/NewRealmWizard/components/AdvancedOptionsDropdown' @@ -799,7 +800,12 @@ const instructions = () => ({ args.oracleOpt || mangoGroup.banksMapByMint.get(mint.toBase58())![0]!.oracle const isPyth = await isPythOracle(connection, oracle) - liqudityTier = await getSuggestedCoinTier(mint.toBase58(), !!isPyth) + liqudityTier = !mint.equals(USDC_MINT) + ? await getSuggestedCoinTier(mint.toBase58(), !!isPyth) + : { + tier: 'PREMIUM', + priceImpact: '0', + } const suggestedPreset = getFormattedListingPresets(!!isPyth)[ liqudityTier.tier! @@ -867,6 +873,15 @@ const instructions = () => ({ {coinTiersToNames[liqudityTier.tier]} check params carefully )} +
+
+
- Proposed values +
+
+
- Suggested by + liqudity +
+