Browse Source

Fix division by zero error

pull/1177/head
Thomas 3 years ago
parent
commit
b39635f56f
  1. 10
      apps/api/src/app/benchmark/benchmark.service.ts

10
apps/api/src/app/benchmark/benchmark.service.ts

@ -48,9 +48,13 @@ export class BenchmarkService {
benchmarks = allTimeHighs.map((allTimeHigh, index) => { benchmarks = allTimeHighs.map((allTimeHigh, index) => {
const { marketPrice } = quotes[benchmarkAssets[index].symbol]; const { marketPrice } = quotes[benchmarkAssets[index].symbol];
const performancePercentFromAllTimeHigh = new Big(marketPrice) let performancePercentFromAllTimeHigh = new Big(0);
.div(allTimeHigh)
.minus(1); if (allTimeHigh) {
performancePercentFromAllTimeHigh = new Big(marketPrice)
.div(allTimeHigh)
.minus(1);
}
return { return {
marketCondition: this.getMarketCondition( marketCondition: this.getMarketCondition(

Loading…
Cancel
Save