fix(#2153): use correct decimal places for marginLevels (#2163)

This commit is contained in:
Bartłomiej Głownia 2022-11-18 18:07:51 +01:00 committed by GitHub
parent 87df790fd1
commit 98a3d2267b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,15 +120,9 @@ export const getMetrics = (
? new BigNumber(0)
: marginAccountBalance.dividedBy(totalBalance).multipliedBy(100);
const marginMaintenance = toBigNum(
marginLevel.maintenanceLevel,
marketDecimalPlaces
);
const marginSearch = toBigNum(marginLevel.searchLevel, marketDecimalPlaces);
const marginInitial = toBigNum(
marginLevel.initialLevel,
marketDecimalPlaces
);
const marginMaintenance = toBigNum(marginLevel.maintenanceLevel, decimals);
const marginSearch = toBigNum(marginLevel.searchLevel, decimals);
const marginInitial = toBigNum(marginLevel.initialLevel, decimals);
const searchPrice = marginSearch
.minus(marginAccountBalance)