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