Merge branch 'main' into dev

This commit is contained in:
tjs 2022-12-13 00:44:27 -05:00
commit ed86f3b224
1 changed files with 6 additions and 6 deletions

View File

@ -103,15 +103,15 @@ export class Group {
Promise.all([
this.reloadBankOraclePrices(client),
this.reloadVaults(client),
this.reloadPerpMarkets(client, ids).then(() =>
this.reloadPerpMarketOraclePrices(client),
),
]),
),
this.reloadMintInfos(client, ids),
this.reloadSerum3Markets(client, ids).then(() =>
this.reloadSerum3ExternalMarkets(client),
),
this.reloadPerpMarkets(client, ids).then(() =>
this.reloadPerpMarketOraclePrices(client),
),
]);
// console.timeEnd('group.reload');
}
@ -346,16 +346,16 @@ export class Group {
) {
const stubOracle = coder.decode('stubOracle', ai.data);
price = new I80F48(stubOracle.price.val);
uiPrice = this?.toUiPrice(price, baseDecimals);
uiPrice = this.toUiPrice(price, baseDecimals);
} else if (isPythOracle(ai)) {
uiPrice = parsePriceData(ai.data).previousPrice;
price = this?.toNativePrice(uiPrice, baseDecimals);
price = this.toNativePrice(uiPrice, baseDecimals);
} else if (isSwitchboardOracle(ai)) {
uiPrice = await parseSwitchboardOracle(
ai,
client.program.provider.connection,
);
price = this?.toNativePrice(uiPrice, baseDecimals);
price = this.toNativePrice(uiPrice, baseDecimals);
} else {
throw new Error(
`Unknown oracle provider (parsing not implemented) for oracle ${oracle}, with owner ${ai.owner}!`,