diff --git a/components/instructions/programs/mangoV4.tsx b/components/instructions/programs/mangoV4.tsx index 92dfb74ca0..5b20b43b00 100644 --- a/components/instructions/programs/mangoV4.tsx +++ b/components/instructions/programs/mangoV4.tsx @@ -803,7 +803,7 @@ const instructions = () => ({ liqudityTier = !mint.equals(USDC_MINT) ? await getSuggestedCoinTier(mint.toBase58(), !!isPyth) : { - tier: 'PREMIUM', + tier: 'ULTRA_PREMIUM', priceImpact: '0', } diff --git a/package.json b/package.json index ced7b3deaa..444065a7f5 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@blockworks-foundation/mango-v4": "0.19.29", - "@blockworks-foundation/mango-v4-settings": "0.2.10", + "@blockworks-foundation/mango-v4-settings": "0.2.11", "@blockworks-foundation/mangolana": "0.0.1-beta.15", "@bonfida/spl-name-service": "0.1.47", "@bundlr-network/client": "0.7.15", diff --git a/utils/Mango/listingTools.ts b/utils/Mango/listingTools.ts index 7ea74f1277..7d44402bcf 100644 --- a/utils/Mango/listingTools.ts +++ b/utils/Mango/listingTools.ts @@ -204,8 +204,20 @@ export const getSuggestedCoinTier = async ( outputMint: string, hasPythOracle: boolean ) => { - const TIERS: LISTING_PRESETS_KEYS[] = ['PREMIUM', 'MID', 'MEME', 'SHIT'] + const TIERS: LISTING_PRESETS_KEYS[] = [ + 'ULTRA_PREMIUM', + 'PREMIUM', + 'MID', + 'MEME', + 'SHIT', + ] + const swaps = await Promise.all([ + fetchJupiterRoutes( + MAINNET_USDC_MINT.toBase58(), + outputMint, + toNative(250000, 6).toNumber() + ), fetchJupiterRoutes( MAINNET_USDC_MINT.toBase58(), outputMint, @@ -226,6 +238,12 @@ export const getSuggestedCoinTier = async ( outputMint, toNative(1000, 6).toNumber() ), + fetchJupiterRoutes( + MAINNET_USDC_MINT.toBase58(), + outputMint, + toNative(250000, 6).toNumber(), + 'ExactOut' + ), fetchJupiterRoutes( MAINNET_USDC_MINT.toBase58(), outputMint, @@ -281,10 +299,15 @@ export const getSuggestedCoinTier = async ( indexForTierFromSwaps > -1 ? TIERS[indexForTierFromSwaps] : 'UNTRUSTED' const tierLowerThenCurrent = - tier === 'PREMIUM' ? 'MID' : tier === 'MID' ? 'MEME' : tier - const isMidOrPremium = tier === 'MID' || tier === 'PREMIUM' + tier === 'ULTRA_PREMIUM' || tier === 'PREMIUM' + ? 'MID' + : tier === 'MID' + ? 'MEME' + : tier + const isPythRecommendedTier = + tier === 'MID' || tier === 'PREMIUM' || tier === 'ULTRA_PREMIUM' const listingTier = - isMidOrPremium && !hasPythOracle ? tierLowerThenCurrent : tier + isPythRecommendedTier && !hasPythOracle ? tierLowerThenCurrent : tier return { tier: listingTier, diff --git a/yarn.lock b/yarn.lock index d67100da89..a66f9885d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -452,10 +452,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@blockworks-foundation/mango-v4-settings@0.2.10": - version "0.2.10" - resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-v4-settings/-/mango-v4-settings-0.2.10.tgz#d09a74b743b1eb44bcad46b09680035fb8ec5a85" - integrity sha512-pQ7TfAxBdoF0fNVQ7PsT4TW5cpGibTjZadXcYlbyfetxQbTQS9mgghfGaq/TDFz/rHa6FS2FJ0xCJBoy7FNDbg== +"@blockworks-foundation/mango-v4-settings@0.2.11": + version "0.2.11" + resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-v4-settings/-/mango-v4-settings-0.2.11.tgz#f573cf3c61c6b31d9097940160f18897219cac80" + integrity sha512-F4cR8gOTcstdrMtbtEDgXb40Jm+7j6HE1PNiu+9UgJ04hsoQFbxbtSIWRh4ZpmiW3Kd4LIOZLNSjzRnAJU8zcg== dependencies: bn.js "^5.2.1" eslint-config-prettier "^9.0.0"