risk: disable for now

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2023-11-16 08:42:18 +01:00
parent c0c96abbec
commit 21b8c0dbfa
1 changed files with 16 additions and 11 deletions

View File

@ -461,20 +461,25 @@ export async function getRiskStats(
.map((bank) => bank.mint.toString()), .map((bank) => bank.mint.toString()),
), ),
]; ];
const prices = await getOnChainPriceForMints([
...new Set( // Note:
Array.from(group.banksMapByTokenIndex.values()) // Disable for now
.flat() // Getting rate limited
.map((bank) => bank.mint.toString()), // const prices = await getOnChainPriceForMints([
), // ...new Set(
]); // Array.from(group.banksMapByTokenIndex.values())
const onChainPrices = Object.fromEntries( // .flat()
prices.map((price, i) => [mints[i], price]), // .map((bank) => bank.mint.toString()),
); // ),
// ]);
// const onChainPrices = Object.fromEntries(
// prices.map((price, i) => [mints[i], price]),
// );
Array.from(group.banksMapByTokenIndex.values()) Array.from(group.banksMapByTokenIndex.values())
.flat() .flat()
.forEach((b) => { .forEach((b) => {
b['onChainPrice'] = onChainPrices[b.mint.toBase58()]; b['onChainPrice'] = b.uiPrice;
}); });
// Clone group, and simulate change % price drop for all assets except stables // Clone group, and simulate change % price drop for all assets except stables