From db4ae6f66622223810c256e81614c2c9c5dfa884 Mon Sep 17 00:00:00 2001 From: dd Date: Wed, 24 Feb 2021 17:00:34 -0500 Subject: [PATCH] fixed bug in get prices --- src/client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 504264c..d11331d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -67,7 +67,9 @@ export class MangoGroup { ): Promise { 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)