fixed bug in get prices

This commit is contained in:
dd 2021-02-24 17:00:34 -05:00
parent bcff05dfc3
commit db4ae6f666
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ export class MangoGroup {
): Promise<number[]> {
const aggs = await Promise.all(this.oracles.map((pk) => (Aggregator.loadWithConnection(pk, connection))))
return aggs.map((agg) => (agg.answer.median.toNumber())).concat(1.0)
return aggs.map((agg) => (agg.answer.median.toNumber() / Math.pow(10, agg.config.decimals))).concat(1.0)
// const oracleAccs = await getMultipleAccounts(connection, this.oracles);
// return oracleAccs.map((oa) => decodeAggregatorInfo(oa.accountInfo).submissionValue).concat(1.0)