From 21b8c0dbfab1dd347a9267386fa5827c06c96cf3 Mon Sep 17 00:00:00 2001 From: microwavedcola1 Date: Thu, 16 Nov 2023 08:42:18 +0100 Subject: [PATCH] risk: disable for now Signed-off-by: microwavedcola1 --- ts/client/src/risk.ts | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/ts/client/src/risk.ts b/ts/client/src/risk.ts index 82d135449..3b8df87ea 100644 --- a/ts/client/src/risk.ts +++ b/ts/client/src/risk.ts @@ -461,20 +461,25 @@ export async function getRiskStats( .map((bank) => bank.mint.toString()), ), ]; - const prices = await getOnChainPriceForMints([ - ...new Set( - Array.from(group.banksMapByTokenIndex.values()) - .flat() - .map((bank) => bank.mint.toString()), - ), - ]); - const onChainPrices = Object.fromEntries( - prices.map((price, i) => [mints[i], price]), - ); + + // Note: + // Disable for now + // Getting rate limited + // const prices = await getOnChainPriceForMints([ + // ...new Set( + // Array.from(group.banksMapByTokenIndex.values()) + // .flat() + // .map((bank) => bank.mint.toString()), + // ), + // ]); + // const onChainPrices = Object.fromEntries( + // prices.map((price, i) => [mints[i], price]), + // ); + Array.from(group.banksMapByTokenIndex.values()) .flat() .forEach((b) => { - b['onChainPrice'] = onChainPrices[b.mint.toBase58()]; + b['onChainPrice'] = b.uiPrice; }); // Clone group, and simulate change % price drop for all assets except stables